This is a draft cheat sheet. It is a work in progress and is not finished yet.
General Commands & Navigation Shortcuts
Command |
Options |
Explanation |
|
echo "This text will be displayed."
|
displays whatever's inside " " |
|
|
displays contents of a file or multiple files |
|
|
change directory |
|
~ |
list contents |
|
|
|
|
|
~ |
|
~ |
|
current user's home directory |
.. |
|
up one directory |
"Show Commands" (The Linux Version)
< Command > |
< Syntax > |
< What It Displays > |
|
|
displays contents of a file or multiple files |
|
|
< Command > |
< Options > |
< What It Displays > |
|
- - - - - - |
list of physical volumes & associated volume groups |
|
|
|
|
|
|
|
< Command > |
< Options > |
< What It Displays > |
|
|
Hardware/System Information |
< Command > |
< Options > |
< What It Displays > |
|
|
|
info on all connected USB devices |
|
|
verbose |
|
|
info for a specific USB |
|
|
shows device hierarchy as a tree |
|
Packages/Device Driver Information |
< Command > |
< Options > |
< What It Displays > |
|
dpkg-query [opt] [file or pkg]
|
installation status, version, dependencies, & description |
|
|
files installed by the package |
|
|
which package installed the file |
|
- - - - - - |
statistics from the apt
package cache |
|
|
list of all installed packages |
|
|
whether a specific package is installed |
|
|
files installed by the package |
|
|
which package installed the file |
|
|
general info about the package |
|
|
Searching
Command |
Searches For: |
Reports: |
|
anywhere the pattern is found (files AND commands) |
location of the binary, the source, & the documentation |
|
location of shell command |
location of the binary & if an alias is being used |
|
faster/easier method Note: May not be current! (use updatedb cmd) |
|
|
searches within a file |
|
commands (?) |
aliases, functions, & commands built-in to the shell |
Filtering & Manipulating Output
Command |
Syntax/Options |
Explanation |
|
|
displays first line(s) |
|
|
specify # of lines to display |
|
|
displays last line(s) |
|
|
specify # of lines to display |
|
~ |
sorts output (alphabetically by default) |
|
|
reverse order |
|
|
by key (can do multiple at once) |
|
|
sort 6th column by month |
|
|
sort 7th column numerically |
|
|
translates (changes) output from another command (must be used w/ pipe) |
|
|
prints the number of lines, words, & bytes |
|
|
prints only number of lines |
|
|
prints only word count |
|
|
prints only byte count |
|
|
prints character count |
|
|
prints length of longest line |
|
|
displays & writes to file simultaneously |
Vi Editor
Command |
Mode |
What It Does |
|
Insert |
undo |
|
To Enter Insert Mode |
|
appends text after cursor |
|