Detailed explanation of alias command (set command alias)

Linux instruction: alias

Function description: Set the alias of the instruction.
Syntax: alias[alias]=[directive name]
Supplementary note: Users can use alias to customize the alias of the command. If only alias is entered, all current alias settings will be listed. 
The effect of alias is only for this login operation. To automatically set an alias every time you log in, you can
set the command alias in .profile or .cshrc.
Parameters: If no parameters are added, all current alias settings will be listed. 

Example: set alias alias ll ='ls -l'
to drive module settings, in /etc/modprobe.conf(modules.conf)
alias eth0 tg3
alias eth1 bcm5700
alias eth2 off delete eth2 module
Use examples.
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
Then execute source .bash_profile to reload the environment variable file.
At this time, you can use the sc alias as a command under the current user, which is equivalent to executing the source ~/.bash_profile command.
If it is under Unix, the method of adding is the same, but the syntax is slightly changed.
 
 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326995294&siteId=291194637