I think that most people who are just starting to use linux only know the input of delete, but it is super convenient to remember shortcuts etc. first, so I will write it here.
The command line of LINUX is EMACS by default, so you can use EMACS in the first place, but the following is a list of shortcuts that you should definitely remember. (* At first, the command may be short and you may not be in trouble, but soon you will need a long command, and it will be troublesome to move with the arrow keys.)
Be sure to remember the shortcut above! !! !! Required.
Auto-fill in one tab: For example, if a file called abc.txt and a file called acd.txt exist in a directory, type "ab" and type "tab" in that directory to automatically enter abc.txt. Will enter it. (This is easier to understand in the video.)
Candidate display with two tabs: If you hit "tab" with "a", you cannot judge which one because there are two abc.txt and acd.txt. However, if you hit "tab" twice in a row with "a", both files will be displayed as candidates! It's convenient.
The command history can be viewed above and below the arrow keys. The up arrow keys move to the old one, and the down arrow keys move to the new one.
You can go back with the arrow keys, but you can use the history command to display the past history at once.
I really just hit it.
history
The following commands are useful for developing a little and finding what you are looking for in history.
history |grep The string you want to search for
→ This "|" can be read as "pipe" and the result of the command can be used as the input for the next command. I won't go into details here, but in the above example, think of passing the history result to grep. grep will find the string you want to search for in the results of the passed history command.
If you give one sample, it looks like this. It extracts the history that contains the character string aws.
history | grep aws
If you think that there are a few, you can narrow down the number by head or tail, or give it to less and take a closer look.
history | grep aws | tail
Recommended Posts