Solve the problem that the Linux system fails after setting the alias command to restart
In most cases, linux is used on the Character interface. We do not want to repeat some long commands every time, which is not only a waste of time but also prone to errors. We will use the alias command to solve this problem.
For example:
Alias ll = 'LS-l -- color'
In this way, we can directly enter ll to replace this long string or longer command.
However, in this case, it will expire after restart. The solution is to edit it ~ /. Bashrc File
Vim ~ /. Bashrc
Add an alias command to each line. For example:
Alias ll = 'LS-l -- color'
Alias la = 'LS-'
Alias cdhome = 'CD ~ '
Alias cdroot = 'CD /'
After wq saves the file, run:
Source ~ /. Bashrc
(Otherwise it will not take effect)
If not, it means no ~ /. Bash_profile file, or the. bashrc file is not executed in the file.
(The. bash_profile file is automatically executed when you log on to the terminal. It is generally called. bashrc)
If so, open the file (if not, create it first:
~ /. Bash_profile
Add a line to it:
Source ~ /. Bashrc
OK.
Articles you may be interested in
- Linux File Content statistics command wc command usage details
- Linux chmod (file or folder permission setting) command parameters and Usage Details
- Solved the problem that the returned content disappears after the form is submitted incorrectly.
- Eight typical Linux operating system applications
- Graphic tutorial on common basic commands in Unix/Linux
- The jquery setting button cannot be clicked to prevent repeated data submission
- Completely solves the adaptive width problem of the Button in IE6 and 7.
- Mysql command to change the table structure: add, delete, modify fields, adjust the field order