Day 3 Task: Basic Linux Commands

Task: What is the linux command to

Day 3 Task: Basic Linux Commands Task: What is the linux command to

In this article, we'll explore fundamental Linux commands frequently used in everyday tasks involving Linux as the operating system.

To view what's written in a file:

"cat" command is used to view the file

To change the access permissions of files:

"chmod" command is used for changing file permission

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

"vim" command to create a file and "cat" command to view a file

To remove a directory/Folder

"rm" command means to remove file/directory

"rm -r" command means to remove recursively

To check which commands you have run till now:

"history" command is used to view all the previous commands.

To add content in devops.txt (One in each line) -

"echo -e 'text' > filename" '-e' is used to enable the '\n' interpretation and '\>' is redirection to a particular file to save the output

To Show only the top three fruits from the file:

"head -n" to show the desired number of lines in a file.

To Show only the bottom three fruits from the file:

"tail -n" to show the desired number of lines in a file.

To create another file colors.txt and view the content:

"touch" command to create a file and "cat" command to view a file

To add content in colors.txt (One in each line) -

"echo -e 'text' > filename" '-e' is used to enable the '\n' interpretation and '\>' is redirection to a particular file to save the output

To find the difference between fruits.txt & colors.txt file

"diff" command is used to show difference in the file