1. cheat-sheets
  2. /command line

Command Line Cheat Sheet

lsLists the files and directories in the current directory
cdChanges the current directory
mvMoves a file or directory to a new location
cpCopies a file or directory to a new location
rmRemoves a file or directory
mkdirCreates a new directory
chmodChanges the permissions of a file or directory
grepSearches for a specified pattern in a file or output
findSearches for a specified file or directory in the file system
tarCreates or extracts files from a tar archive
manShows the manual page for a command
catConcatenates and displays the contents of one or more files
topDisplays real-time information about running processes
historyShows a list of recently used commands
pingTests the connection to a specified network host
chownChanges the owner of a file or directory
dfDisplays the amount of free space on a file system
duShows the size of a file or directory
echoPrints a message to the terminal
headDisplays the first few lines of a file
lessDisplays the contents of a file one page at a time
tailDisplays the last few lines of a file
touchCreates an empty file or updates the timestamp of an existing file
unameShows information about the current system
wcCounts the number of lines, words, and characters in a file
apt-getInstalls or removes packages from the package manager
yumInstalls or removes packages from the package manager
systemctlControls the system service manager
serviceControls the system service manager
sshConnects to a remote server over a secure shell connection
chrootChanges the root directory of the current process
cronSchedules commands to be run at a specified time
crontabEdits the crontab file for scheduling tasks
curlTransfers data from or to a server using various protocols
diffShows the differences between two files
dmesgShows the kernel message log
freeShows information about memory usage
gzipCompresses or decompresses a file using the gzip algorithm
unzipExtracts files from a zip archive
killSends a signal to a process to terminate it
locateSearches for a file or directory in the system database
nanoA text editor for the terminal
passwdChanges the password for a user account
psShows a list of running processes
rebootRestarts the system
routeShows or modifies the routing table
sedEdits a file or stream by applying a set of commands
sortSorts the lines of a file or stream
teeSends output to both the terminal and a file
timeShows the time taken to run a command
tracerouteShows the path taken by packets to a specified host
viA text editor for the terminal
wgetDownloads a file from the internet
awkA programming language for text processing
bashThe default shell for most Linux systems
chgrpChanges the group of a file or directory
clearClears the terminal screen
dateShows the current date and time