LPIC Cheat Sheet 1- Basic Command Line Tools
Rouzbeh Sabzehei
Backend and Systems Developer | Rust | Node.js | Go | Solidity | Blockchain | Linux
$ echo
Prints a text or an input to the output.
$ pwd
This command prints the absolute path of current working directory. It displays the path starting from the root directory.
$ cd
This command changes your current working directory.
$ type
Displays type of the command or symbol, indicating whether its a shell bultin command or symbol or if it's not.
$ uname
Simple tool for displaying system information.
$ ls
List information about files and directories.
$ which
Locate a command. but only if it resides in your PATH directories.
$ man
Useful command for displaying system reference manual pages, including commands documentation, program syntax and so on.
$ history
Displays your recent commands history.
$ nano
$ emacs
$ vim
Most popular tools for editing text files.
$ cat
Displays a text file content to the output.
$ od
Converts a text file content into an octal and other formats. It doesn't change the original file.
领英推荐
$ split
Useful utility for splitting large text files into smaller chunks. it can divide up files using size, line count and so on.
$ sort
Another useful tool for sorting file's data.
$ nl
Displays line numbers of a text file.
$ more
$ less
Tools for paging through large text files.
$ head
Displays first lines of a text file (10 lines by default).
$ tail
Displays last lines of a text file (10 lines by default).
$ wc
Displays bytes count, words count and number of lines in a text file.
$ md5sum
$ sha256sum
$ sha512sum
Utilities for deploying different hash algorithms on files.
$ grep
Powerful tool for filtering and searching a text file using regular expressions (regex).
$ [COMMAND] > [FILE]
$ [COMMAND] 2> [FILE]
Redirects command's standard output (>) or error (2>) to a file. If it exists, overwrites it, if it doesn't, creates one.
$ [COMMAND] >> [FILE]
$ [COMMAND] 2>> [FILE]
Redirects command's standard output (>) or error (2>) to a file. If it exists, appends to it, if it doesn't, creates one.
$ [COMMAND] &> [FILE]
$ [COMMAND] &>> [FILE]
Use & in redirecting for both standard output and error redirections.
$ [COMMAND] < [FILE]
Redirects standard input from specific file into a command.
$ [COMMAND] | [COMMAND]
Piping is a technique for redirecting a command's standard output to another command's standard input.