Skip to main content

Everyday Linux Commands

· 6 min read

I use these Linux commands over and over in daily work, so rather than searching for them every time, I've organized them into a quick-reference note. They're grouped by CPU, memory, files, and system, with a list of frequently used commands at the end.

CPU Commands

# Number of physical CPUs
grep 'physical id' /proc/cpuinfo | sort -u | wc -l

# Number of CPU cores
grep 'core id' /proc/cpuinfo | sort -u | wc -l

# Number of CPU threads
grep 'processor' /proc/cpuinfo | sort -u | wc -l

# CPU model
dmidecode -s processor-version

# Detailed CPU information
cat /proc/cpuinfo

Memory Commands

# Current memory usage
free -h

# Top 10 processes by memory usage
ps aux | head -1;ps aux |grep -v PID |sort -rn -k +4| head -10

File Commands

ls # show files or directories
ls -l # list files with details (list)
ls -a # list all files and directories in the current directory, including hidden ones (all)
mkdir # create a directory
mkdir -p # create a directory, creating parent directories as needed (parent)
cd # change directory
touch # create an empty file
echo # create a file with content
cat # view file contents
cp # copy
mv # move or rename
rm # delete a file
rm -r # delete recursively, including subdirectories and files
rm -f # force delete
find # search the filesystem for a file
wc # count lines, words, and characters in text
grep # search for a string in a text file
rmdir # delete an empty directory
tree # show a directory as a tree; requires the tree package
pwd # show the current directory

System Commands

# Show system information
lsb_release -a

# Query the kernel version
uname -r

Frequently Used Commands

  1. cd: change the current working directory
  2. ls: list files and subdirectories in the current working directory
  3. mkdir: create a new directory
  4. rm: delete files or directories
  5. cp: copy files or directories
  6. mv: move files or directories
  7. touch: create a new file or update an existing file's access and modification times
  8. cat: view file contents
  9. grep: search for a specific string in files
  10. find: locate files in the filesystem
  11. chmod: change file or directory permissions
  12. chown: change file or directory ownership
  13. top: show the processes currently running on the system
  14. ps: list currently running processes
  15. ssh: connect to a remote host over a secure shell
  16. scp: copy files between hosts over a secure shell
  17. tar: create or extract tar archives
  18. gzip: compress files
  19. unzip: decompress files
  20. ping: test network connectivity to another host
  21. ifconfig: show and manage network interfaces
  22. route: show and manage the network routing table
  23. netstat: show network status information
  24. iptables: manage firewall rules
  25. systemctl: manage system services
  26. service: manage system services
  27. du: show disk usage of directories and files
  28. df: show filesystem disk usage
  29. uname: show system information
  30. date: show or change the system date and time
  31. history: show the history of previously executed commands
  32. man: view a command's manual page
  33. which: find the path of a given command
  34. whereis: find the path and manual page of a given command
  35. whoami: show the current user's username
  36. su: switch to another user or the superuser
  37. sudo: run a command with superuser privileges
  38. ssh-keygen: generate an SSH key pair
  39. ssh-copy-id: copy an SSH public key to a remote host
  40. scp: securely copy files over SSH
  41. curl: send requests to a server and fetch the response
  42. wget: download files from the web
  43. vim: a powerful text editor
  44. nano: an easy-to-use text editor
  45. tar: create or extract tar archives
  46. gzip: compress files
  47. bzip2: compress files
  48. unzip: decompress files
  49. zip: create or extract zip archives
  50. sshfs: mount a remote filesystem over SSH
  51. rsync: sync files and directories remotely
  52. awk: process and analyze text
  53. sed: process and transform text
  54. sort: sort lines of text
  55. uniq: remove duplicate lines from text
  56. cut: extract columns from text
  57. paste: merge text columns into a single file
  58. tee: copy standard output to a file and the terminal
  59. diff: compare the differences between two files
  60. patch: apply a patch from a diff file
  61. head: show the first lines of a file
  62. tail: show the last lines of a file
  63. tar: create or extract tar archives
  64. gzip: compress files
  65. bzip2: compress files
  66. unzip: decompress files
  67. zip: create or extract zip archives
  68. rpm: install, remove, and query RPM packages
  69. dpkg: install, remove, and query Debian packages
  70. ps: list running processes
  71. kill: stop a running process
  72. top: show the processes currently running on the system
  73. uptime: show system uptime and load
  74. free: show system memory usage
  75. df: show filesystem disk usage
  76. du: show disk usage of directories and files
  77. mount: mount a filesystem
  78. umount: unmount a filesystem
  79. chroot: change the root directory
  80. ln: create symbolic or hard links
  81. echo: print text or variables
  82. export: set environment variables
  83. source: execute a script and import it into the current shell
  84. alias: create an alias
  85. unalias: remove an alias
  86. jobs: list currently running jobs
  87. bg: send a job to run in the background
  88. fg: bring a job back to the foreground
  89. nohup: run a job in the background so it survives closing the terminal
  90. crontab: set up scheduled tasks
  91. at: run a command at a specified time
  92. screen: create multiple terminal sessions
  93. tmux: create multiple terminal sessions
  94. curlftpfs: mount a remote filesystem over FTP
  95. dig: query DNS servers
  96. nslookup: query DNS servers
  97. ping: test network connectivity to another host
  98. traceroute: show the path packets take through the network
  99. tcpdump: capture network packets
  100. iftop: show network traffic information

Wrapping Up

Nobody remembers every command — what matters is knowing where to look them up. This note collects the commands I use most, grouped by CPU, memory, files, and system, and together with the man pages it covers most troubleshooting scenarios. As new commands worth recording come up, I'll keep adding them here.

COMMENTS