This is a draft cheat sheet. It is a work in progress and is not finished yet.
System
cat /proc|/sys |
Print the content of kernel memory |
df |
Display free disk space |
dmesg |
Print kernel and driver messages |
dmidecode |
Display hardware information from the BIOS |
du |
Estimate file/directory space usage |
free/vmstat |
Display memory usage |
lshw / lspci / lsusb |
Display hardware information |
strace |
Trace system calls and signals of a process |
sync |
Synchronize data on disk with memory |
uname |
Print system information |
File
cat |
Print the content of a file |
cmp |
Compare two files byte by byte |
diff |
Compare files line by line |
file |
Determine file type |
head |
Output the first part of a file |
less |
Display output one screen at a time |
more |
Display output one screen at a time |
sort |
Sort text file |
tail |
Output the last part of a file |
tee |
Redirect output to multiple files |
touch |
Change file timestamp/create empty file |
truncate |
Shrink or extend the size of a file |
which |
Locate a command on $PATH (and in aliases) |
Users
getent passwd |
Get user entries from NSS |
id |
Print real and effective user and group |
|
|
Shell
env |
Display current user environment variables |
false |
Do nothing, unsuccessfully |
source |
Read and execute commands from filename |
true |
Do nothing, successfully |
Search
find |
Search for files in a directory hierarchy |
grep |
Find pattern in a file by lines |
locate |
Find files (in locatedb generated by updatedb) |
Network
arp |
Manipulate system arp cache |
dig |
DNS lookup utility |
ip |
Manipulate network interfaces settings |
mtr |
Network diagnostics |
netstat |
Print network statistics |
ping |
Send ICMP echo requests to network hosts |
tcpdump |
Dump network traffic |
Processes
kill |
Send a signal to a process |
lsof |
List open files |
pkill |
Send a signal to a process by name or other attributes |
pmap |
Report memory map of a process |
ps |
Report a snapshot of a current process |
pstree |
Display the process tree |
watch |
Execute a program periodically and capture the output |
|