Linux environment variable in bash shell

Aliases

Aliases are shortcuts to commands. For those who need to perform frequently, but take a long time long command input is useful to create a shortcut. The syntax is:

alias ppp='ping www.baidu.com'

They are not always used to shorten long commands. It is important that you use them for tasks you perform frequently. Possible examples:

alias update='yum update'

This can be accomplished simply by yum update update command is operated
to set the alias in question is in the terminal, the session is closed once the terminal, the alias will be lost. To permanently set them up, use the resource file.


resource

Resource files (ie rc file) is in session or when the process starts (each user to open a new terminal window or start vim and other new procedures) loaded configuration file. For ZSH, the resource file is .zshrc, for bash, it is .bashrc.

To make an alias to become permanent aliases, you can put them in a resource file. You can use a text editor to edit the resource file of your choice. As used herein vim:

vim $HOME/.zshrc

Or for bash:

vim $HOME/.bashrc

After we create a new terminal, you can still use the command that we created to accomplish some of the longer command operation

Guess you like

Origin www.cnblogs.com/7haoyu/p/11265827.html