Skip to main content

Things to remember

To read the complete documentation about how to use any of the linux command, just use man follwed by the command

Example

$ man ls
$ man chown
$ man chgrp

To clear the terminal screen we use clear command to give terminal a clean look. It’s not about deleting files or data, only just resetting the visual display in your terminal.

$ clear

Piping and Redirection:

  • > - Redirect output to a file (overwrites).
    $ ls -l > filelist.txt
  • >> - Append output to a file.
    $ echo "New line" >> filelist.txt
  • | - Pipe output of one command to another.
    $ ls | grep ".txt"

Wildcards and Globbing:

  • * - Matches any number of characters.
  • ? - Matches exactly one character.
    $ ls *.txt # List all text files
    $ ls file?.txt # Matches file1.txt, file2.txt, etc.

Command History and Shortcuts:

  • history - Show command history.
  • ! - Execute commands from history.
    $ history
    $ !5 # Execute command number 5 from history