[实践OK]Mac OS使用ll、la、l等ls别名,Mac 下ll命令 command not found。

jackxiang 2018-6-26 18:11 | |
背景:在Linux下习惯使用ll、la、l等ls别名的童鞋到mac os可就郁闷了,
whichi ll
-bash: whichi: command not found
[xiangdong@jenkins_server_bj_sjs_10_71_182_25 .ssh]$ which ll
alias ll='ls -l --color=auto'
        /bin/ls
其实只要在用户目录下建立一个脚本“.bash_profile”,并输入以下内容即可:


ls -l --color=auto

1 2014-461deMacBook-Pro:~ root# cd ~
2 2014-461deMacBook-Pro:~ root#vim .bash_profile
加入:


  保存后,执行

3 2014-461deMacBook-Pro:~ root#source .bash_profile
=============================================

.bash_profile

alias l='ls -alhF'
alias la='ls -AFh'
alias ll='ls -lhAF'
alias l='ls -alhF'
alias la='ls -AFh'
alias ll='ls -lhAF'

然后在终端窗口中输入下列命令后,别名即可立即生效:
source ~/.bash_profile
source ~/.bash_profile

如果不知道如何创建,可以直接在“终端”窗口中依次执行如下命令:

.bash_profile完整创建命令Shell

cd ~
touch .bash_profile
echo "alias l='ls -alhF'" >>.bash_profile
echo "alias la='ls -AFh'" >>.bash_profile
echo "alias ll='ls -lhAF'" >>.bash_profile
source ~/.bash_profile

cd ~
touch .bash_profile
echo "alias l='ls -alhF'" >>.bash_profile
echo "alias la='ls -AFh'" >>.bash_profile
echo "alias ll='ls -lhAF'" >>.bash_profile
source ~/.bash_profile

来自:https://clang.cn/blog/749.html
https://www.cnblogs.com/daly2008/p/4160066.html

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/9802/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2018-6-26 18:13
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]