Skip to main content

Command Palette

Search for a command to run...

Linux commands for DevOps (Practice commands used in day-to-day activities)

Published
2 min read
A

👩‍💻 Hey there! I'm a DevOps engineer and a tech enthusiast with a passion for sharing knowledge and experiences in the ever-evolving world of software development and infrastructure. As a tech blogger, I love exploring the latest trends and best practices in DevOps, automation, cloud technologies, and continuous integration/delivery. Join me on my blog as I delve into real-world scenarios, offer practical tips, and unravel the complexities of creating seamless software pipelines. Let's build a strong community of tech enthusiasts together and embrace the transformative power of DevOps!

#DAY3 Of #90daysOfDevOps

Task: What is the Linux command to-

To view what's written in a file.

cat [filename]

To change the access permissions of files - done by using "chmod" Command.

In linux there are three permission of every file i.e. read(r), write(w), execute(x), also we can give permission to user in user group and other manner.

u : owner permission + : add permission

g : group permission - : remove permission

o : other user permission = : assign permission

Syntax to change access permission in file-

chmod <u,g,o><+,-,=><r,w,x> <filename>

To Check which commands you have run till now.

history

To remove a directory/ Folder.

To remove a directory with its contents, use rmdir -r

Command to delete forcefully all the data, rmdir -rf

rmdir option [foldername]

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

touch fruits.txt
cat fruits.txt

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

Create the file using touch command.

touch [filename]

open vi editor and add (Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava), one in each line.

NOTE: Press "i" to enter into insert mode.

now type ":wq" to save

Now give cat command to see the content of file:

Show top three fruits from the file

Show bottom three fruits from the file

Create another colors.txt file and view its content

touch colors.txt
cat colors.txt

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

open vi editor, press " i " to enter into "insert mode" and add Red, Pink, White, Black, Blue, Orange, Purple, Grey (One in each line), press " :wq " to save.

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

To compare the contents of two files, use the diff command. 📊

diff fruits.txt Colors.txt

Conclusion:

🐧💻 Mastering Linux commands opens a world of possibilities. Practice, explore, and unleash the full potential of the command line for efficient and powerful control over your Linux system! 🚀⌨️✨

Keep practicing, keep learning, and let the command-line prowess elevate your Linux experience to new heights!

Happy command-line adventures! 🐧💻✨

More from this blog

DevOps & AWS Essentials

38 posts