-bash: ll: 未找到命令


第一步将alias ll='ls -l'添加到/etc/profile

# head /etc/profile
# /etc/profile
alias ll='ls -l'
# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.

第二步

# source /etc/profile

#ll

###################################################

问题:常用命令“ll”失效,如图所示

 

"ll"命令不是linux的基本命令,它是"ls -l"的别名,部分版本并不直接支持“ll”命令输出。

 

解决方法:

运行“vi ~/.bashrc”,查看该文件里是否有“alias ll='ls -l'”这样的数据,如有,将数据前的“#”去掉,如果没有,将“alias ll='ls -l'”加进去并保存,然后运行“source ~/.bashrc”命令,即可成功。如下图:


————————————————
版权声明:本文为CSDN博主「themeth」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/themeth/java/article/details/81005632


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM