Linux Command Line Cheat sheets-[A list of Shortcuts]
Linux: Linux command is the Service of Linux operating systems. All the tasks either it is basic or advanced tasks can be done by executing the Linux commands. Below in this article, you can get to know about the basic Linux commands that are used commonly. To know about this in detail, read the article fully.
Last updated on Sep 13, 2021.
Download Linux command line Cheatsheet for offline study here: Linux command line Cheatsheet.PDF
Linux Bash Commands
This command shows the system and the kernel.
Displays the mounted file.
Displays the system date.
To present the uptime.
This command displays your username.
Displays the system date.
This presents the manual for the command.
Linux Shortcuts for bash
To stop the current command.
Shortcut for sleep program.
To go to the start of the line.
This shortcut is to go to the end of the line.
This is to cut from the start of the line.
To cut to the end of the line.
Shortcut for search history.
To repeat the last command.
This shortcut is to run the last command starting with abc.
To print the last command starting with abc.
To execute the last word of the previous command.
Last argument of the previous command.
To get to all the arguments of the previous command.
This shortcut runs the previous command, replacing abc with 123.
Linux Bash Variables
This one shows the environmental variables.
This presents the output value of the $NAME variable.
To set $ name to value.
Executable search path.
Variable is a Home directory.
variable for the current shell.
Here, cmd refers to the command.
This command is the input of cmd from the file.
This is for the output of cmd2 as file input to cmd1.
This command is for the standard output of cmd to file.
This command is to discard the standard out (stdout) of cmd.
To add stdout to file.
This command is for the error output of cmd to file.
stdout to the same place as stderr.
stderr to the same place as stdout.
Indicates the shortcut to every output to file.
stdout of cmd1 to cmd2
stderr of cmd1 to cmd2.
To run cmd1, then cmd2.
cmd1 && cmd2
to run cmd2 if cmd1 is successful.
This command is to run cmd2 if cmd1 is not successful.
To run cmd in a subshell.
It shows the current directory.
To make directory dir.
To change directory to dir.
This is to go up a directory.
To list files.
To show all the files including hidden one.
For recursive list.
To reverse the order.
To sort by the last modified.
This is to arrange by the file size.
To form a long-lasting list format.
This command is for one file per line.
To get comma-separated output.
To get quoted output.
grep pattern files
To search for the pattern in files.
This enables case-insensitive search.
For recursive search.
For inverted search.
This pattern shows the matched part of the file only.
This pattern finds files starting with the name in dir.
find/dir/ -user name
Find files owned by name in dir.
To find files modified less than num minutes ago in dir.
This one pattern is to find binary, source, manual for the command.
This command finds the files.
Is to create file 1.
cat file 1file 2
To concatenate files and output.
less file 1
To view and paginate file 1.
This is to get a type of file 1.
cp file1 file2
To copy file 1 and file 2.
This is to move file 1 to file 2.
rm file 1
For deleting file 1.
head file 1
This is to show the first 10 lines of file 1.
tail file 1
To show the last 10 lines of file 1.
tail -F file 1
This command outputs the last lines of file 1 as it changes1.
watch -n 5’ntpq -p’
This command issues the ‘ntpq -p’ command every 5 seconds and display the output.
This one displays the snapshot of processes.
Displays the show real-time processes.
This kill process with id pid.
To kill the process with name name.
This kills all processes with names beginning name.
To read the file.
This is a shortcut is to save files.
Shortcut to close the file.
This shortcut is to start marketing text.
To cut marked text or line.
Shortcut to paste text
Navigation shortcut key to go to the end of the file.
To navigate to the beginning of the file.
Navigating shortcut key to the end of the line.
To show line number.
To go to line number.
This shortcut is to find.
To find next
Shortcut key to search and replace.
To start a screen session.
To resume a screen session.
Displays your current screen sessions.
To activate commands for the screen.
Generate a new instance of terminal.
To go to the next instance of terminal.
This shortcut is to go to the previous instance of the terminal.
To show current instances of the terminal.
To rename the current instance.
chmod 775 file
To change the mode of a file to 775.
chmod -R 600 folder
For to recursively chmod folder to 600.
chown user group file
To change file owner to user and group to group.
File permission Numbers
This number is to read (r).
To execute (x).
In this article, we explained the basic Linux commands that are used commonly. Thank you for visiting this site.