第一步將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