MAC操作系統添加命令別名
OS X是基於Unix內核的圖形化操作系統,在日常開發中也經常會使用Terminal進行命令行進行交互,所以設置一些常用的命令別名也是非常必要的。
如何設置別名
vi ~/.bash_profile
添加需要設置的命令和別名,由於OS X不能直接用ll命令,以此爲例:
alias ll='ls -l'
使別名生效:
source ~/.bash_profile
驗證一下:
shenjiangangdeMacBook-Pro:blog shenjg$ ll
total 248
-rw-r--r--@ 1 shenjg staff 1880 7 30 20:41 _config.yml
-rw-r--r-- 1 shenjg staff 174 8 3 11:22 db.json
drwxr-xr-x 311 shenjg staff 9952 8 2 16:39 node_modules
-rw-r--r-- 1 shenjg staff 112244 8 2 16:39 package-lock.json
-rw-r--r-- 1 shenjg staff 564 8 2 16:34 package.json
drwxr-xr-x 14 shenjg staff 448 8 3 11:18 public
drwxr-xr-x 5 shenjg staff 160 4 16 16:18 scaffolds
drwxr-xr-x 6 shenjg staff 192 4 16 17:41 source
drwxr-xr-x 6 shenjg staff 192 7 30 20:36 themes