码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2014-11-20 11:54:44      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   ar   使用   sp   文件   on   div   

设置`.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/sh

sudo ifconfig en0 down
sudo 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

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

标签:blog   http   io   ar   使用   sp   文件   on   div   

原文地址:http://www.cnblogs.com/ihojin/p/mac-align.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!