系统中已经设定的别名: 1.alias scpzfl='sh /home/user/abc.sh' 2.alias sshzfl='sh /home/user/abc.sh' -------------------------------------------------------------------- alias使用方法: alias 新的命令=‘原命令 -选项/参数’ unalias:删除一个别名 例:unalias sshzfl alias -p 查看系统已经设置的别名
alias命令的作用只局限于该次登入的操作。若要每次登入都能够使用这些命令别名,则可将相应的alias命令存放到bash的初始化文件/etc/bashrc中。 Aliases are recongnized only by the shell in which they are created,and they apply only for the user that creates them,unless that user is the root user,which can create aliases for any user.
---------------------------------------------------------------------------- In the case of Red Hat Linux,an alias for any user can be added to the ".bashrc"file in that user's home directory.Because this file is read at login,the change will not take effect until the user has logged in again. Aliases for the root user can be made permanent by entering them in the .bashrc file in the root's home directory,i.e.,in /root/.bashrc.System-wide aliases can be put in the /etc/bashrc file. The system needs to be restarted before system-wide aliases can take effect.