Show Menu
Cheatography

AHJ - Linux Basics 01 Cheat Sheet (DRAFT) by

Linux basic commands

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

File operations

ls [<p­ath­>]
List files and directories
Useful options:
 
-l
long / wide view
 
-a
show hidden files and direct­ories
 
-h
human-­rea­dable sizes
 
-R
show directory content recurs­ively
 
-b
show escape chars in names
 
-ltr
reverse sort files by modified date
 
Use --help to show additional options
touch <fi­le>
create empty file
cat <fi­le1> [<f­ile­2>]
dump contents of file1 to stdout
 
concat file1 & file2 to stdout
head <fi­le>
dump first 10 lines of file to stdout
tail <fi­le>
dump last 10 lines of file to stdout
 

Directory Operations

cd [dir]
change directory
mkdir [/dir/­path]
make directory
 
-p
with parent dirs as needed