The Most Common Linux Commands

So you’re learning your way around the Linux commandline and there are all these commands you have to know. It turns out, all of those commands are programs that you can find in:

  • /bin/
  • /usr/bin/

And if you want to learn more about them, try typing one of these:

man something

something --help

The Most Common Commands

Don’t Panic

Okay, this list may seem a little long. It is. But each of these tools is likely to be on every Linux computer you see for the rest of your life. They can become the toolbox you use to build practically anything.

  • | - “pipe” the outputs of one command into another
  • > - “pipe” the outputs of a command into a file
  • » - “append” the outputs of a command to a file
  • awk - programming language for pattern-matching and parsing text
  • bg - places the current job in the background
  • cat - display and concatenate files
  • cd - change directory
  • chmod - change the permissions on a file (or files)
  • chown - change the owner of a file (or files)
  • cp - copies a file (or directory if you use -r)
  • crontab - run programs at regular intervals
  • cut - remove sections from each line in a file
  • date - prints the current date/time to the terminal
  • echo - print a string to the terminal
  • emacs - a command line text editor (VIM is better)
  • exit - close the terminal or exit your shell script
  • fg - brings a background job to the foreground
  • find - search for files inside a directory
  • grep - search for a string in a file (or files)
  • gunzip - Decompress a ZIP file
  • gzip - Compress a file using the GZIP utiltity
  • head - Shwo the first N lines in a file.
  • history - show the last N commands you’ve typed in
  • htop - Show the processes currently running on your computer.
  • killall - kill all processes that match a name
  • ls - lists the contents of a directory
  • make - run Makefiles to build code (originally for C code)
  • man - print the “man”ual for the program
  • mkdir - make new directories
  • mv - move a file (or files)
  • ping - test if an IP (or web) address is reachable
  • pkill - kill process by ID or name
  • ps - show the running processes
  • pwd - print the path to you current directory
  • rm - remove a file (or files)
  • rsync - copy (and synchronize) files easily
  • scp - “secure copy” files over an SSH connection
  • sed - programming language for filtering and transforming text
  • screen - manage multiple Linux commandline sessions
  • sleep - idle. wait. Do nothing for N seconds.
  • sort - alphabetize a list of strings (usually a file)
  • su - enter the “super user”, where you have heightened permissions
  • sudo - “super user do” one command, with heightened permissions
  • tail - Show the last N lines in a file.
  • tar - create, compress, and decompress tar balls
  • time - calculate how long any command takes to run
  • top - What processes are running? (htop is better)
  • uname - print information about the operating system
  • uptime - Tell how long the system has been running.
  • vi - A commandline text editor (replaced by VIM)
  • vim - The best commandline text editor.
  • wc - “word count” in a file (or “line count” if you add -l)
  • which - Show the path to the program.
  • zip - compress a file (or directory) with ZIP

Bonus Round

How did I generate this list? Actually, I used four of the above commands together!

history | awk -F " " '{print $2}' | sort -u

Try it out. Can you explain how this works?

Published: August 19 2019