MACOS下使用alias命令

记得某个同事曾经说mac是UNIX系统,没有ll、la、tailf命令,那是因为他不知道alias命令,alias字面意思是别名,在linux或macos里就是设置指令别名的命令。

语法:

    alias name='command line'

用法:

    alias grep='grep --color'

列出所有的设置:

   alias 或 alias -p

针对某个用户生效:

   放到 /Users/用户/.profile 文件

针对全部用户生效:

    放到 /etc/profile 文件

现奉上我的MAC的所有配置:

alias ls='ls -G'
alias ll='ls -l' #哈哈~
alias la='ls -a' #mac使用la命令
alias grep='grep --color'
alias find='find --color'
alias git='git --color'
alias mcd='/Users/xxx/server.info/mcd'
alias le60='/Users/xxx/server.info/le60'
alias le47='/Users/xxx/server.info/le47'
alias le6='/Users/xxx/server.info/le6'
alias let='/Users/xxx/server.info/let'
alias le35='/Users/xxx/server.info/le35'

注意使用 source .profile 让配置生效

--end--

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容