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