Linux Command Cheat Sheet
Share This Cheat Sheet
Basic commands
File management
File Utilities
Memory & Processes
|
Pipe (redirect) output
find
search for a file
tr -d
translate or delete character
free -m
display free and used system
memory
sudo [command]
run < command> in superuser
ls -a -C -h
list content of directory
uniq -c -u
report or omit repeated lines
mode
killall
stop all process by name
rm -r -f
remove files and directory
split -l
split file into pieces
nohup [command]
run < command> immune to
sensors
CPU temperature
hangup signal
locate -i
find file, using updatedb(8)
wc -w
print newline, word, and byte
database
counts for each file
top
display current processes, real
man [command]
display help pages of
time monitoring
< command>
cp -a -R -i
copy files or directory
head -n
output the first part of files
kill -1 -9
send signal to process
[command] &
run < command> and send task
du -s
disk usage
cut -s
remove section from file
to background
service
manage or run sysV init script
file -b -i
identify the file type
diff -q
file compare, line by line
[start|stop|restart]
>> [fileA]
append to fileA, preserving
existing contents
mv -f -i
move files or directory
join -i
join lines of two files on a
ps aux
display current processes,
common field
snapshot
> [fileA]
output to fileA, overwriting
grep, egrep, fgrep -i -v
print lines matching pattern
contents
more, less
view file content, one page at a
dmesg -k
display system messages
time
echo -n
display a line of text
sort -n
sort lines in text file
File compression
xargs
build command line from
Disk Utilities
previous output
comm -3
compare two sorted files, line
by line
tar xvfz
create or extract .tar or .tgz
1>2&
Redirect stdout to stderr
files
df -h, -i
File system usage
cat -s
concatenate files to the
fg %N
go to task N
standard output
gzip, gunzip, zcat
create, extract or view .gz files
mkfs -t -V
create file system
jobs
list task
tail -f
output last part of the file
uuencode, uudecode
create or extract .Z files
resize2fs
update a filesystem, after
lvextend*
ctrl-z
suspend current task
zip, unzip -v
create or extract .ZIP files
fsck -A -N
file system check & repair
rpm
create or extract .rpm files
Scripting
pvcreate
create physical volume
bzip2, bunzip2
create or extract .bz2 files
File permission
awk, gawk
pattern scanning
mount -a -t
mount a filesystem
rar
create or extract .rar files
tsh
tiny shell
fdisk -l
edit disk partition
chmod -c -R
chmod file read, write and
executable permission
" "
anything within double quotes
lvcreate
create a logical volume
File Editor
is unchanged except \ and $
touch -a -t
modify (or create) file timestamp
umount -f -v
umount a filesystem
' '
anything within single quote is
chown -c -R
change file ownership
ex
basic editor
unchanged
chgrp -c -R
change file group permission
python
"object-oriented programming
vi
visual editor
Misc Commands
language"
touch -a -t
modify (or create) file
nano
pico clone
timestamp
bash
GNU bourne-again SHell
pwd -P
print current working directory
view
view file only
ksh
korn shell
bc
high precision calculator
emacs
extensible, customizable editor
php
general-purpose scripting
Network
expr
evaluate expression
language
sublime
yet another text editor
cal
print calender
csh, tcsh
C shell
netstat -r -v
print network information,
sed
stream editor
routing and connections
export
assign or remove environment
perl
Practical Extraction and Report
pico
simple editor
variable
Language
telnet
user interface to the TELNET
protocol
` [command]
backquote, execute command
source [file]
load any functions file into the
Directory Utilities
current shell, requires the file
tcpdump
dump network traffic
date -d
print formatted date
to be executable
ssh -i
openSSH client
$[variable]
if set, access the variable
mkdir
create a directory
ping -c
print routing packet trace to
rmdir
remove a directory
host network
Read the Blog Post »
Compiled by Alvin Khoo
bit.ly/Linux-Commands