Skip to content

Instantly share code, notes, and snippets.

@adityajn105
Last active November 18, 2020 03:32
Show Gist options
  • Save adityajn105/baf7cf8d4843f2d0e2734ea6dcd1b726 to your computer and use it in GitHub Desktop.
Save adityajn105/baf7cf8d4843f2d0e2734ea6dcd1b726 to your computer and use it in GitHub Desktop.
Important Linux Command
  1. Process related command
  • top - real time view of all process running
  • ps -aus - snapshot of all process running
  • kill -9 PID - kill a process with PID as process id.
  • nohup cmd > logs.out & - Run a process in background and deattach from terminal.
  • screen - Start a screen terminal (-r restore, -ls view, Ctrl-A + d deattach screen)
  1. Filesystem related
  • ls -la - list all files in current directory
  • wc -l - Count number of lines in a file
  • df - list of all filesystem mounted, with total/available/percent usage.
  • lsblk - list of all block devices, use df instead.
  • du -h dir - Human readable disk usage by files/directory.
  • ls -l dir | wc -l - Count of files in a directory
  1. Machine related
  • lscpu - CPU related information like arch, total cpus, cache details etc.
  • cat /etc/os-release - OS related information
  • cat /proc/meminfo - RAM related info
  1. Network related
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment