31/10/2021
Five practical guides for managing Linux terminal and commands
In this article we will take a brief look at some time saving tricks you can use when interacting with the terminal. As a system administrator you will spend most, if not all, of your time in a terminal. Knowing tricks like these can save you a lot of time and make you a more efficient system administrator. These skills aren’t just useful for only administrators though. All of these shortcuts can be used by anyone who interacts with a command line interface. Check these out and enjoy!
1- Keys for Command Line Editing
If you are familiar with Linux, then we are guessing you know how to run commands by typing them in at the shell prompt. The text you type at a shell prompt is called the command line (it’s also called the input line). The following table describes the keystrokes used for typing command lines.
---------------------------------------------------------------------------------------
Keystroke - Function
Up Move back one command in the history list
Down Opposite of Up arrow (moving forward one command)
Left Move the cursor back one character.
Right Move the cursor forward one character.
Esc f Move the cursor forward one word.
Esc b Move the cursor back one word.
Ctrl-A Move the cursor to the start of line.
Ctrl-E Move the cursor to the end of line.
Ctrl-D Delete current character. Beginners usually confuse this with Backspace
Backspace Delete previous character.
Esc d Delete current word.
Ctrl-K Kill or cut all text on the input line, from the character the cursor is underneath to the end of the line
Ctrl-U Delete from beginning of line.
Esc k Delete to end of line.
Ctrl-Y Fetch last item deleted.
Esc . Insert last word of previous command.
Ctrl-L or Ctrl-I Clear the screen, placing the current line at the top of the screen. Alternatively, you can use “clear” command.
Tab Try to complete the current word, interpreting it as a filename, username, variable name, hostname, or command based on the context.
Esc ? List or suggest the possible completions
In addition to keystrokes covered in the above table, often you may run into situations when you have to suspend a currently executed command, so to do so you just type Ctrl-C or Curl-Z to cancel its ex*****on. These keystroke commands are very handy, for instance, when a program is taking too long to execute and you want to try something else.
The following sections describe some important features of command line editing, such as quoting special characters and strings, re-running commands, running multiple commands, and command history. Here is a good article if you like to learn more about how Linux OS works.
This article is written by Matt Zand and Kevin Downs
You can read the full article by following the link below:
By Matt Zand and Kevin Downs In this article, we will take a brief look at some time-saving tricks you can use when interacting with the terminal. As a system administrator, you will spend most, if not all, of your time in a terminal. Knowing tricks like these can save you a lot of time …