alias
? shell ?    2019-01-11 16:22:44    583    0    0
gua_l   ? shell ?

在linux 操作时一些频繁使用的长命令,经常使用别名代替,简化输入。

个人使用:在$HOME目录下 ,配置文件vi ~/.bash_profile

加入 alias <alias_name>='CMD' ,命令用单引号括起,多条命令用分号隔开。


alias ftpcasa='ftp ftp.xxx.com'​
alias cdsvn='cd /var/svn/svn_dir'

保存后使配置生效:

source  ~/.bash_profile

全局使用:需 root 权限 在/etc/profile中加入alias 条目,

source  /etc/profile 

配置生效后,执行cdsvn ,等效于执行

cd /var/svn/svn_dir

root@tclserver:~# cdsvn
root@tclserver:/var/svn/svn_dir# pwd
/var/svn/svn_dir

Pre: GitLab GEO 异地主副服务器同步--文档翻译

Next: mount/nfs 共享目录

583
Sign in to leave a comment.
No Leanote account? Sign up now.
0 comments
Table of content