Use of Alias commands in Linux/Unix

Source: Internet
Author: User

Linux Command:Alias

Function Description:Set the alias of the command.
Syntax:Alias [alias] = [command name]
Note:You can use alias to customize the alias of the command. If you only enter alias, all current alias settings can be listed.
Alias is valid only for this login operation. To automatically set an alias for each login, you can
Or set the alias of the command in. cshrc.
Parameters:If no parameter is added, all current alias settings are listed.

Example: Set the alias LL = 'LS-l'
Set the driver module in/etc/modprobe. conf (modules. conf)
Alias eth0 tg3
Alias eth1 bcm5700
Alias eth2 off Delete eth2 Module
Example.
Environment red hat linux 9.0
Edit the user's environment variable file. bash_profile
Add the following line
Alias SC = "Source ~ /. Bash_profile"
Alias P = "PS-U $ user"
Save and exit
Run source. bash_profile to reload the environment variable file.
In this case, you can use the alias SC as the command under the current user, which is equivalent to executing source ~ /. Bash_profile command.
In UNIX, the method is the same, but the syntax is slightly changed.

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.