linux-shell (3) Bash basic commands-command aliases and commonly used shortcut keys

1: Command alias alias alias = “Original command” Set the command alias; the alias defined by the command line will only take effect at zero time, and will disappear after restart.

alias query command alias

                               

The reason why the command can be used directly is because the PATH environment variable is used.

Command execution order:

The first order executes commands executed with an absolute path or a relative path, the second order executes aliases, the third order executes Bash's internal commands such as cd using whereis to find the directory where the command is located, and the fourth order executes according to $ PATH The first command found in the directory search order defined by the environment variables.

2: To make the alias permanent, it is to modify the document vi /root/.bashrc, add the relevant commands to the file, if it is a non-root user, it is the .bashrc file under the user

The difference between vi and vim is that vi has no color, vim has color

3: Delete alias unalias alias

4: The shortcut keys commonly used by Bash can be viewed under https://www.runoob.com/w3cnote/bash-shortcut.html Among them are often used: ctrl + C ctrl + L ctrl + U ctrl + Y ctrl + R ctrl + D

Published 158 original articles · Like 10 · Visitors 20,000+

Guess you like

Origin blog.csdn.net/ab1605014317/article/details/105462225