Skip to main content

Command Palette

Search for a command to run...

Day:03 Basics Linux Commands..!!

Updated
2 min readView as Markdown
Day:03 Basics Linux Commands..!!

Task: What is the Linux command to

  1. To view what's written in a file

    Cat <filename>- The cat command reads each File parameter in sequence and writes it to standard output. If you do not specify a file name, the cat command reads from standard input. You can also specify a file name of - (dash) for standard input.

  2. To change the access permissions of files.

    Chmod <permissions> <filename> - Linux chmod command is used to change the access permissions of files and directories. It stands for change mode.

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

    History- Linux history command is used to display the history of the commands executed by the user.

  4. To remove a directory/ Folder.

    rm -rf <dirname> - rm command to remove files you no longer need. The rm command removes the entries for a specified file, group of files, or certain select files from a list within a directory.

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

    touch<filename>-The touch command updates the access and modification times of each file specified by the File parameter of each directory specified by the Directory parameter.

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

    Vim-Vim is a text editor that is an upgraded version of the Vi editor and is more compatible with Vi. The most usage of vi editors is to create a new file, edit an existing one, or just read one.

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

    head <option> <filename> -head command is a command-line utility, which prints the first 10 lines of the specified files.

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

    Tail <option> <filename>-Tail is a command which prints the last few numbers of lines (10 lines by default) of a certain file, then terminates.

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

    vi colors.txt

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

    diff-The diff command compares text files. It can compare single files or the contents of directories

Thanks for reading the article.!!.

See you in the next one.

More from this blog

Untitled Publication

18 posts