Show Menu
Cheatography

Linux Commands Cheat Sheet (DRAFT) by

Basic Linux commands

This is a draft cheat sheet. It is a work in progress and is not finished yet.

pwd

/home/username
print working directory

cat [FILE]

concat­enate files and print to standard output

cat example.md

# Hello World


This is an example text file.
concat­enate files and print on the standard output

Common Shortcuts in the terminal

CTRL+c
Cancel current commant
CTRL+d
Log out. Same as when you type
exit
.
CTRL+r
Seach shell history
CTRL+S­HIFT+v
Paste clipboard without formatting
CTRL+u
Cut character after cursor to the beginning of line (to the left)
CTRL+k
Cut character after cursor to the end of line (to the right)
CTRL+a
Go to beginning of line
CTRL+e
Go to end of line
sudo!!
Repeat last command with sudo

df

-h, --huma­n-r­eadable
print sizes in powers of 1024 (e.g., 1023M)
 -H, --si
print sizes in powers of 1000 (e.g., 1.1G)
report file system disk space usage
 

cd [FOLDER]

cd /home/­use­rna­me/­Dow­nloads
change directory

cp

-R, -r, --recu­rsive
copy direct­ories recurs­ively
copy files and direct­ories

mv SOURCE DEST

Move a file
mv /downl­aod­s/file /documents
Move folder to another folder
mv /downl­aod­s/f­older /docum­ents/
Move containing files of a folder to another folder
mv /downl­aod­s/f­older/ /docum­ents/
Move, rename files and direct­ories
Be carefull with trailing slashes:
folder/
is different than
folder

mkdir [FODLER]

mkdir myfolder
creates a folder
mkdir -p folder­1/f­old­er2­/fo­lder3
Creates folders if they do not exist
Make direct­ories

ls

-l
long list format
-a, --all
do not ignore entries starting with .
-h, --huma­n-r­eadable
will print sizes like 1K 234M 2G etc. when used with
-l
-1
list one file per line
-S
sort by file size, largest first
list directory contents