Day 3 - Basic Linux Commands

Day 3 - Basic Linux Commands

What is the Linux command to

1-To view what's written in a file

The "Cat" Command is used to view the data or content written inside the file in the linux.

2-To change the access permissions of files.

The "chmod (change mode)" command is used to manage file system access permissions. We can find permissions of files and folders using ls -l command. In Linux, there are three types of owners: user, group, and others. File permissions fall in three categories: Read, Write, and Execute.

Above is the table with numeric values of premission

3-To check which commands you have run till now.

history command is used to check which command we have used till now

4-To remove a directory/ Folder.

To remove an empty directory, use the rmdir folder_name command and to remove a directory and all its contents, including any subdirectories and files use rm -r folder_name(Here 'r' stands for removing recursively)

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

We can use touch command to create the file and cat command to view the content of the file.

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

1-By using the vim editor we can add content in the file vim fruits.txt

f2-or adding content press i then add content

3-Then press Esc and save the file by entering :wq(write and quit that file)

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.

Let's Connect On Linkedin

Thankyou for reading!! many more in a queue

~Nikunj Kishore Tiwari

Great initiative by the #trainwithshubham community. Thank you Shubham Londhe for Guiding Us.

#devops #90daysofdevops #allaboutdevops #linux