What is the Linux command to
Cat
The cat command is used to view what's written in a file.chmod
The command name "chmod" stands for "change mode." It restricts the way a file can be accessed.
To change the access permissions of fileshistory
The history command in Linux is a built-in shell tool that displays a list of commands used in the terminal session. history allows users to reuse any listed command without retyping it.
To check which commands you have run till now.To remove a directory/ Folder.
to remove the file
rm<filename>
to remove the directory
rmdir <directory_name>
To create a fruits.txt file and to view the content.
the
vim
text editor is used to create and edit files and thecat
command is used to view the content of the file.Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
Show only the top three fruits from the file.
head -3 devops.txt
is used to print down the first 3 lines from a file.Show only the bottom three fruits from the file.
tail -3 devops.txt
is used to print down the first 3 lines from a file including space.To create another file Colors.txt and to view the content.
touch <filename>
is used to create a new file.Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, and Grey.
To find the difference between fruits.txt and the Colors.txt files.
diff
command is used to list the difference between two files.
Thanks for reading! I hope you understood these concepts and learned something.
If you have any queries, feel free to reach out to me on LinkedIn.