DAY-2&3 #90DaysofDevOps

Farhan ShamimFarhan Shamim
4 min read

Hello folks. This task is related to basic Linux commands so before jumping into that let me give a short introduction to Linux. After that, there is a task in which I am following #90DaysOfDevops with #TrainWithShubham. Your feedback is appreciated.

LINUX

Introduction of Linux

Linux is a kernel based on the UNIX operating system, not an operating system which many people have a misconception about. Linux is an operating system, just like Windows or macOS, that runs on computers and other devices. It was created by a person named Linus Torvalds.

What makes Linux different is that it is free and open-source, which means that anyone can use it, modify it, and share it with others. This openness has led to a large community of people who work together to improve and develop Linux.

Linux is known for its stability and security. It is used on many different types of devices, from big servers to small smartphones. It can also be customized to suit different needs and preferences.

While Linux can be controlled using commands typed into a special interface called the command line, there are also versions of Linux that have a more familiar graphical interface with icons and windows, similar to other operating systems.

Overall, Linux is a versatile and powerful operating system that offers a free and open alternative to other systems.

Tasks:

Task: What is the linux command to

1. To view what's written in a file.
2. To change the access permissions of files.
3. To check which commands you have run till now.
4. To remove a directory/ Folder.
5. To create a fruits.txt file and to view the content.
6. Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
7. To Show only top three fruits from the file.
8. To Show only bottom three fruits from the file.
9. To create another file Colors.txt and to view the content.
10. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
11. To find the difference between fruits.txt and Colors.txt file.

1. To view what's written in a file.

Cat: This is used to concatenate and display files on the terminal. It can also be used to modify existing ones.

cat -b: This adds line numbers to non-blank lines

cat -n: This adds line numbers to all lines

cat -s: This squeezes blank lines into one line

cat –E: This shows $ at the end of the line

2. To change the access permission of files.

chmod: The chmod command is used to change the permissions of files and directories. It allows you to specify who can read, write, and execute a file.

The basic syntax of the chmod command is:

3. To check which command you have run till now.

history: The history command shows you all the commands you have run till now.

4. To remove a directory / folder

rm: The rm command is used to delete files or directories and the contents within them.

rm -r: Deletes the folder or directory recursively.

rm -rf: Force removal of the folder or directory.

Note: Be very careful with this command this will delete everything and there is no undo.

5. To create a fruits.txt file and to view the content.

touch: the touch command is used to create the file.

Cat: then we can use cat command to view it.

6.Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.

Open the vim editor by entering vim devops.txt

then you can run the cat command and print it.

7. To Show only top three fruits from the file.

We will use the awk command and head command to extract a part of a specified information .

8.To Show only bottom three fruits from the file.

We use the tail command and same as above.

9. To create another file Colors.txt and to view the content.

10. Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, and Grey.

11. To find the difference between fruits.txt and Colors.txt file.

We have created fruits.txt by the touch command and we have stored nothing on it whereas Color.txt was created by vim editor where we mentioned all the colors name and then printed it by the cat command.

Some useful Tips when using Terminal👇

• Use the TAB button to autofill what you are typing.

• Use the clear command to clean up the terminal

• Use Ctrl+C to stop an execution

• If you accidentally freeze your terminal by using Ctrl+S, simply undo this with the unfreeze Ctrl+Q.

In the end, Basic Linux commands will help you execute tasks easily and effectively. It might take a while to remember some of the basic commands, but nothing is impossible with lots of practice.

Get Connected:

If you have any suggestion about this post feel free to let me know and be updated on my blog in the following ways:

linkedIn

Twitter

Github

#TrainWithShubham #DevOps #Linux

5
Subscribe to my newsletter

Read articles from Farhan Shamim directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Farhan Shamim
Farhan Shamim

Hello there! I'm FARHAN SHAMIM, a passionate DevOps enthusiast and an aspiring blogger. I recently entered the exciting world of DevOps, and I'm eager to share my experiences and insights with the community through my blog. As a DevOps fresher, I have a strong foundation in software development and operations. I possess a solid understanding of various DevOps principles, tools, and methodologies. My goal is to bridge the gap between development and operations teams, streamlining processes, and fostering collaboration to deliver high-quality software solutions efficiently. Throughout my educational journey, I gained hands-on experience with popular DevOps tools such as Git, Jenkins, Docker, Kubernetes, and Ansible. I have a deep understanding of continuous integration and delivery pipelines, infrastructure automation, configuration management, and cloud platforms like AWS, Azure, and Google Cloud. My curiosity and passion for technology drive me to stay updated with the latest industry trends and advancements. I am always eager to learn new technologies and expand my skill set. I thrive in dynamic environments that encourage innovation and value a proactive approach to problem-solving. Alongside my DevOps journey, I have discovered my love for writing. Blogging provides me with a platform to express my ideas, share my knowledge, and contribute to the larger DevOps community. Through my blog, I aim to provide valuable insights, tutorials, best practices, and tips for fellow DevOps professionals, as well as beginners looking to explore this fascinating field. I believe in the power of collaboration and community engagement. I actively participate in DevOps forums, attend meetups, and engage with like-minded professionals to foster knowledge exchange and build meaningful connections. Join me on my DevOps journey through my blog, where I'll share practical tutorials, real-world experiences, and thought-provoking articles. Together, let's embrace the DevOps culture, foster innovation, and empower organizations to achieve continuous improvement and delivery excellence. Feel free to connect with me through my blog, social media channels, or email. I'm always open to collaborations, discussions, and opportunities to learn and grow together. Let's make a positive impact on the DevOps community and beyond!