Linux & Terminal · Cheatsheet
Linux Commands Cheatsheet
Essential Linux commands for file management, processes, networking, and system administration
61 commands 8 sections
No entry matches that filter.
-
ls -laList all files with details -
cd <dir>Change directory -
pwdPrint working directory -
mkdir -p <dir/sub>Create nested directories -
rm -rf <dir>Remove directory recursively (use with caution) -
cp -r <src> <dest>Copy directory recursively -
mv <src> <dest>Move or rename file/directory -
touch <file>Create empty file or update timestamp -
ln -s <target> <link>Create symbolic link -
find . -name "*.log"Find files by name pattern
-
cat <file>Display file contents -
less <file>View file with pagination -
head -n 20 <file>Show first 20 lines -
tail -f <file>Follow file updates in real-time -
wc -l <file>Count lines in file -
sort <file>Sort file lines -
uniqRemove duplicate adjacent lines -
diff <file1> <file2>Compare two files
-
grep -r "pattern" .Search recursively in files -
grep -i "pattern" <file>Case-insensitive search -
grep -n "pattern" <file>Search and show line numbers -
grep -v "pattern" <file>Show lines NOT matching -
find . -type f -mtime -7Files modified in last 7 days -
find . -size +100MFiles larger than 100MB -
locate <filename>Fast file search (uses index) -
which <command>Show path of command binary
-
chmod 755 <file>Set rwxr-xr-x permissions -
chmod +x <file>Make file executable -
chmod -R 644 <dir>Set permissions recursively -
chown user:group <file>Change file owner and group -
chown -R user:group <dir>Change ownership recursively -
umask 022Set default file creation permissions
-
ps auxList all running processes -
ps aux | grep <name>Find process by name -
topReal-time process monitor -
htopInteractive process viewer -
kill <PID>Send SIGTERM to process -
kill -9 <PID>Force kill a process -
killall <name>Kill all processes by name -
nohup <cmd> &Run command immune to hangups -
bg / fgMove job to background / foreground
-
curl -X GET <url>Make HTTP request -
wget <url>Download file from URL -
ping <host>Test network connectivity -
netstat -tulpnShow listening ports -
ss -tulpnShow listening ports (modern) -
ip addr showShow network interfaces -
dig <domain>DNS lookup -
ssh user@hostSSH into remote machine -
scp <file> user@host:<path>Copy file to remote machine
-
df -hShow disk space usage -
du -sh <dir>Show directory size -
free -hShow memory usage -
uname -aShow system information -
uptimeShow system uptime -
whoamiShow current user -
hostnameShow system hostname
-
https://www.gnu.org/software/coreutils/manual/GNU Coreutils: file, text, ownership, and permission commands. -
https://www.gnu.org/software/bash/manual/GNU Bash: shell builtins and job control. -
https://curl.se/docs/manpage.htmlcurl: HTTP request options and their limits. -
https://man.openbsd.org/sshOpenSSH: remote connection options.