在Archlinux里,经常 使用ls等相关命令,但是Archlinux默认是黑白界面,超级丑,为此对其修改,使得其结果带有颜色。

我们先看一下默认的效果:


修改/etc/profile文件,修改后的文件如下所示:

# /etc/profile

#Set our umask
umask 022

# Set our default path
PATH="/usr/local/sbin:/usr/local/bin:/usr/bin"
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
	for profile in /etc/profile.d/*.sh; do
		test -r "$profile" && . "$profile"
	done
	unset profile
fi

# Source global bash config
if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then
	. /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH
export LS_OPTIONS="--color=auto -N -T 0"
alias ls="ls $LS_OPTIONS"
alias ll="ls -l"
alias lf="ls -F"
alias la="ls -a"
alias lt="ls -t"
alias lx="ls -X"
alias l="ls -lA"
alias l.="ls -d .*"

备注:有些命令,是根据个人喜好,自己添加的。

修改后,执行 . /etc/profile  使得修改立即生效。

再次执行 ls 命令 即可查看效果





Logo

更多推荐