The most essential Linux commands
Keep this Linux cheat sheet on your desk printed,
it will help you to learn them quick and become a Linux expert very soon.
Click on the image to open at full size
File Commands1) The ls Linux command lists files and directories within the current working directory.
2) The cd Linux command changes the current directory in Linux and can toggle between directories conveniently.
3) The pwd Linux command (print working directory) command displays the name of the current working directory.
4) The mkdir (make directory) command is used to make a new directory.
5) rm (short for remove) is a Unix / Linux command which is used to delete files from a filesystem.
6) The cp command is used to copies files and directories
7) mv (short for move) is a Unix command that moves one or more files or directories from one place to another.
8) The link command creates a hard link named FILE2 which shares the same index node as the existing file FILE1. Since FILE1 and FILE2 share the same index node, they will point to the same data on the disk, and modifying one will be functionally the same as modifying the other.
9) The touch command updates the access and modification times of each FILE to the current system time.
If you specify a FILE that does not already exist, touch creates an empty file with that name unless the -c or -h options are specified
10) cat command It has three related functions with regard to text files: displaying them, combining copies of them and creating new ones.
11) more is a filter for paging through text one screen at a time.
12) The less command lets an admin scroll through configuration and error log files, displaying text files one screen at a time, with backward or forward moving available in files.
SSH(SSH client) is a program for logging into a remote machine and for
executing commands on a remote machine, It is intended to replace rlogin
and rsh, and provide secure encrypted communications between two
untrusted hosts over an insecure network.
InstallationInstalling from source works on any GNU/Linux system that has the compiler and related tools and libraries, follows this route once you have a source package:
Unpack the archive and cd to its base directory.
Run the configure script ./configure
Compile the software make
Install the software make install
Network1) ping is a simple way to send network data to, and receive network data from, another computer on a network. It is frequently used to test, at the most basic level, whether another system is reachable over a network, and if so, how much time it takes for that data to be exchanged
2) whois searches for an object in a WHOIS database. WHOIS is a query and response protocol that is widely used for querying databases that store the registered users of an Internet resource, such as a domain name or an IP address block, but is also used for a wider range of other information.
3) The command dig is a tool for querying DNS nameservers for information about host addresses, mail exchanges, nameservers, and related information. This tool can be used from any Linux (Unix) or Macintosh OS X operating system. The most typical use of dig is to simply query a single host.
4) wget is a free utility for non-interactive download of files from the web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies.
System info1) The date command is used to print out, or change the value of, the system's time and date information.
2) Display a conveniently-formatted calendar from the command line.
3) uptime tells you how long the system has been running.
4) The w command is a quick way to see who is logged on and what they are doing.
5) This command prints the username associated with the current effective user ID
6) Print information about the current system
7) Show / check cpu information on Linux
8) show/check memory information on Linux
10) On Linux and other Unix-like operating systems, man is the interface used to view the system's reference manuals.
11)The df command reports the amount of available disk space being used by file systems
12) du command estimates and displays the disk space used by files.
13) Linux free- Command Displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel
14) Linux whereis app command Locates the binary, source, and manual page files for a command.
15) linux command which app
Searching1) grep linux command : grep, which stands for "global regular expression print," processes text line by line and prints any lines which match a specified pattern
Process Managment1) ps displays information about a selection of the active processes.
2) kill is used to send a signal to a process
3) bg is a job control command that resumes suspended jobs while keeping them running in the background.
4) the fg command continues a stopped job by running it in the foreground
File PermissionsLinux chmod command is used to change the permissions of files or directories
chmod octal file - change permission of file
Compression1) The tar program is used to create, maintain, modify, and extract files that are archived in the tar format
c - create archive
t - table of contents
x - extract
f - specifules filename
z - use zip/gzip
j - bzip2 compression
k - do not overwrite
T - files from file
w - ask for confirmation
V - verbose
2) Gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz, while keeping the same ownership modes, access and modification times.