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

使用Mac命令别名,提升工作效率

时间:2019-01-05 13:22:39      阅读:300      评论:0      收藏:0      [点我收藏+]

标签:文件的   地址   use   user   efault   objective   tor   term   lib   

为系统添加命令别名可以提高我们的工作效率,告别命令繁琐,庸长的的烦恼。

Mac的~/.bash_profile文件提供了为系统添加命令别名的地方。所以我们要操作的也是这个文件。

下面是修改~/.bash_profile文件的步骤。

在mac中设置命令别名的方法如下:

1.编写或者新建~/.bash_profile文件,并添加常用命令别名如下:

#详细打印
alias ll=ls -Alh
#代码片段目录
alias snip=cd ~/Library/Developer/Xcode/UserData/CodeSnippets
#XCode代码缓存目录
alias xcodeCC=cd ~/Library/Developer/Xcode/DerivedData
#显示隐藏文件
alias showAll=defaults write com.apple.finder AppleShowAllFiles -bool true;KillAll Finder
#关闭隐藏文件
alias showPart=defaults write com.apple.finder AppleShowAllFiles -bool false;KillAll Finder
#打印IP地址
alias ip=ifconfig en0
#将OC源码编译成C、C++
alias cc=clang -rewrite-objc
#将OC源码编译成C、C++
alias cc2=clang -x objective-c -rewrite-objc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
注意:“=”两边不要加空格
 
2.:wq保存之后重新打开terminal或者执行命令:source ~/.bash_profile
命令别名GitHub仓库地址:https://github.com/zhfei/aliases
常用命令逐步完善中

使用Mac命令别名,提升工作效率

标签:文件的   地址   use   user   efault   objective   tor   term   lib   

原文地址:https://www.cnblogs.com/zhou--fei/p/10224000.html

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