The Linux Commands Reference Cheat Sheet

most-used-linux-terminal-cmds

The Linux command line, also known as the terminal, can be an intimidating place. But it can also be your most effective tool.

Unlock the "Essential Linux Commands" cheat sheet now!

This will sign you up to our newsletter

Enter your Email

Text commands often work regardless of which Linux-based operating system you use, and the results are often faster than what a graphical desktop interface can offer.

Yet even for long-time users, there are too many commands to commit to memory. That’s why we’ve prepared this handy cheat sheet of Linux commands.

The Linux Command Line Cheat Sheet

Terminal
clearClear the terminal screen.
historyDisplay recently used commands. You can also view these commands via the Up and Down keys.
!Repeat a recently used command. You can use !n to repeat the n-th command in history or !-n to repeat what happened n commands ago.
manDisplay the manual for a terminal program.
whatisDisplay a brief description of a terminal program. A simpler alternative to the man command.
aliasCreate a shortcut to a command or, when combined with the cd command, directory.
exitExit or close the terminal.
Navigation & File Management
cdChange directory. Used to navigate between folders.
pwdDisplay current directory.
cdChange current directory.
lsDisplay a list of files in the current directory.
cpMakes a copy of a file. Defaults to the current directory unless you specify a specific one.
mvMove a file from one directory to another.
rmRemove a file or set of files.
statDisplay when a file was last accessed, modified, or changed.
touchChange the date accessed or date modified time of a given file to right now.
rmdirDelete a file or files.
mkdirCreate a directory. Defaults to the current directory, but you can also specify one.
rmdirDelete a directory. Defaults to the current directory, but you can also specify one. The target directory must be completely empty.
renameChange the name of a file or set of files.
findSearch a specific directory (or your entire PC) to find files that match designated criteria.
locateSearch for files or directories. Faster than the find command, but has fewer options.
grepSearch a specific file or set of files to see if a string of text exists and where.
mountAttach a separate filesystem (such as an external hard drive or USB stick) to your system's main filesystem.
umountDetach a separate filesystem from your system's main filesystem.
catDisplay the contents of a text file. Also works with multiple files.
chmodModify the read, write, and execute permissions of a file.
chownChange the user or group that owns a file.
Users
suSwitch user. Unless you desigate a specific user, this command will attempt to sign in as the root user (which you can think of as the system administrator).
whoamiDisplays the current user name.
idDisplay current user and group.
passwdCreate or update a user's password.
System Administration
unameDisplays core system information such as kernel version, hardware, and operating system.
sudoEnter before a command to perform the command as a system administrator. User must have administrator priveleges for this to work.
apt/dnf/pacmanPrograms for installing software and updates. Which one to use depends on your Linux-based operating system. Each requires administrator rights and additional instructions, such as sudo apt install program-name .
jobsDisplay the status of all current jobs. A job is a representation of a running process or group of processes.
bgSend a job to the background.
fgSend a job to the foreground.
killEnd a process according to its process ID (which you can get using the ps command.
killallEnd all processes whose names match your query.
psDisplay a list of running processes. Defaults to processes started by the current user.
topDisplays a list of running processes, sorted by how much CPU each uses. Unlike ps, the command updates in real-time.
uptimeDisplays time since last boot.
whereisFinds the executable file for a program.
dfDisplays how much disk space is used and free on your system.
freeDisplays how much RAM is used and free on your system.
Network Management
ipDisplays you IP address, network interfaces, bandwidth usage, and more.
pingSend or receive data from another computer on a network. Often used to test whether a network connection is established and the speed of that connection.
digLook up a domain's DNS address
wgetDownload a file.
sshSecure Shell. Connect and login to a remote network location.
Miscellaneous
echoDisplay a line of text. Often used in programs and scripts to relay information to users.
factorDisplays possible factors of a decimal number.
exprSolve math equations.
lookLook up a word in the dictionary.

More Linux Terminal Commands

As comprehensive as this Linux commands cheat sheet may be, the list is only scratching the surface. There is far more you can do in the terminal than we could ever hope to fit on one page. Plus many commands change depending on your Linux-based operating system or require installing additional programs. The commands above are likely to work out-of-the-box on most Linux machines.

All the items in this cheat sheet are useful, but there are other Linux commands that are just plain fun. Then, on the flip side, there are commands that no one should ever run.

Read the full article: The Linux Commands Reference Cheat Sheet



from MakeUseOf http://bit.ly/2R10CUt
via IFTTT