Day3 - Basic Linux Commands

Shreya BhatShreya Bhat
1 min read

#Day3 of #90DaysOfDevopsChallenge

1. To view what's written in a file

Ans :- cat file_name

  1. To change the access permissions of files.

    Ans :- chmod 777 file_name

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

    Ans :- history

  3. To remove a directory/ Folder.

    Ans :- rm - rk ./directory_name or rmdir

    rm filename

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

    Ans :- Nano file_name

    Insert the content

    Save the content

    Cat file_name

  5. Add content in devops.txt (One in each line) - Blore, Mysore, Delhi, Pune

    Ans:- echo content >> file_name

  6. To Show only top three cities from the file.

    Ans:- head file_name -n 3

  7. To Show only bottom three cities from the file.

    Ans:- tail file_name -n 3

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

    Ans :- nano file_name - to create a file and add the content

    cat file_name

  9. Add content in Colors.txt (One in each line)

    echo content >> file_name

  10. To find the difference between cities.txt and bikes.txt file.

0
Subscribe to my newsletter

Read articles from Shreya Bhat directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shreya Bhat
Shreya Bhat

I write blogs about DevOps current and emerging tools/technologies.