As Linux is the most commonly used server operating system, it is necessary to master its common commands. This article has collected the most common Linux commands to help you find them quickly.

The file system

  • Ls — lists the contents of the directory
  • Find – Locates a file according to some user-specified criteria
  • CD – Directory navigation
  • PWD — Displays your current directory location
  • Cp — copies files and folders
  • Mv – Moves files and folders
  • Rm — Delete files and folders
  • Mkdir – Create or make a new directory
  • Umask — Sets the file mode creation mask
  • Chmod — Changes access to a file system object
  • Chown — Changes the file owner and group

File operations

  • Vi — Text editor
  • Cat — displays the contents of the file
  • Tac – Reverse output file content
  • More — Displays the contents of a file one screen/page at a time
  • Less — Similar to the more command, it has additional functions
  • Tail — Used to display the end of text file or pipe data
  • Grep – Searches the file for character patterns and displays all matching lines
  • Sed – Batch file character processing
  • Tar — archiving utility
  • Gzip – File compression and decompression
  • Zip — Used to package and compress (archive) files
  • Touch — Used to update the date of access and/or modification of a computer file or directory
  • Dd – Convert and copy files

The remote access

  • SSH — Secure command line access to remote Linux systems
  • SCP — Use SSH to securely copy files
  • Rsync — Remote file transfer and synchronization
  • Ping – send to the network host
  • Wget — Retrieves files over HTTP, HTTPS, FTP, and FTPS
  • Curl – Transmits data over various network protocols (supports more than WGET)
  • Host — Performs a DNS lookup in Linux

System management

  • Useradd – Creates a new user or updates the default new user information
  • Userdel — Used to delete the user account and all associated files
  • Usermod — Used to modify or change any properties of an existing user account
  • Passwd — Changes the user’s password
  • Sudo — Execute commands with administrative privileges
  • Nohup — Runs commands in the background
  • Clear — Clears the terminal screen
  • Last — Displays a list of the last logged in users
  • W — Displays a list of currently logged in user sessions
  • Cron — Sets the scheduled task to run
  • Man — Used to read the system reference manual
  • Kill — Kill the process
  • Killall — Sends a kill signal to all instances of the process by name
  • Dmesg – Prints the message buffer of the kernel ring
  • Journalctl — Queries systemd logs
  • Sleep — Pauses program execution for a specified period of time
  • Wait — Pauses script execution until all jobs running in the background have been terminated
  • Fdisk — Operates the disk partition table
  • Parted — Used to create and manipulate partitioned tables
  • Blkid — command line utility for locating/printing block device properties
  • MKFS — Build the Linux file system
  • FSCK — tool for checking file system consistency
  • Mount /umount — Provides access to an entire file system in a directory

Monitor resources

  • IP –TCP/IP networking and flow control utilities
  • Df — Displays disk space usage
  • Du — Estimates file space usage
  • Free — Displays memory usage
  • Uptime — Displays system uptime and average load
  • Top — Displays the overall system view
  • Vmstat — Displays system memory, processes, interrupts, paging, block I/O, and CPU information
  • Ss — Investigate the socket utility
  • Ps — Information about the processes currently running

Copyright notice. This article first appeared in Digital Magic Box to reprint.