Solve the problem that the Linux system fails after setting the alias command to restart

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.