Skip to main content

Command Palette

Search for a command to run...

Day3: Basic Linux Commands

Updated
2 min readView as Markdown
Day3: Basic Linux Commands

Day3: 90 days of DevOps -

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

    -> We can use the "cat" command to see the content of a file.

  2. To change the access permission of files.

    -> The command "chmod" is used to change the permission of files which is followed by a numerical number, where 4 = Read, 2 = Write and 1 = Execute.

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

    -> We use the "history" command to see all the previous commands we have run so far.

  4. To remove a directory/folder.

    -> To delete a directory, we use the "rm -r" command which can even remove a non-empty directory.

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

    -> We use the "touch" command to create a file and the "cat" command to view its content.

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

    -> There are several editors we can use to edit files. First, we create the devops.txt file using the "touch" command and edit it using "nano/vim/gedit".

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

    -> The command "head" is used to print the top of the content followed by the flag "-n" which shows the number of lines to print.

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

    -> The command "tail -n" is used to print the bottom of the file's content.

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

    -> Use the command "touch" to create the file and "cat" to view its content.

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

    -> You can use "vim/nano" to edit the file.

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

    -> We can use the "diff" command to find the difference between these files.

More from this blog

Untitled Publication

28 posts