Mac: Alias[设置命令的别名]

来源:互联网 发布:淘宝买家秀怎么发微淘 编辑:程序博客网 时间:2024/05/01 04:25

转自:http://www.cnblogs.com/ihojin/p/mac-align.html

设置.bash_profile

1.打开终端Terminal
2.输入命令cd ~到用户主目录

$ cd ~

3.生成一个新文件

$ touch .bash_profile

4.使用喜欢的方式编辑.bash_profile文件,也可以使用-e参数,使用TextEdit打开文件

$ open -e .bash_profile

5.更新内建命令

$ source .bash_profile 

.bash_profile中增加命令别名

alias restart_network=/Users/mac/.command/RestartNetwork.sh

重启网络

#!/bin/shsudo ifconfig en0 downsudo ifconfig en0 up//RestartNetwork.sh 中的内容

参考:

  • http://blog.marslightstudio.com/?p=122
  • http://witcheryne.iteye.com/blog/1683484
  • http://baike.baidu.com/subview/49616/5092575.htm?fr=aladdin
1 0
原创粉丝点击