为什么我的gnome-terminal中ls没有颜色了

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
linuxier
帖子: 317
注册时间: 2008-05-27 10:45
联系:

为什么我的gnome-terminal中ls没有颜色了

#1

帖子 linuxier » 2008-09-13 13:02

以前在gnome-terminal中用ls还有颜色的,现在突然发现没有了

用下面的命令没有颜色,其实在.bashrc中有定义alias的,
ls
但用下面命令有颜色
bash
ls
不知道为什么,我好像也没有改什么东西,
knowfarway
帖子: 877
注册时间: 2007-08-25 10:37

#2

帖子 knowfarway » 2008-09-13 13:42

你到其它用户下面去复制一份配置文件过来试试吧
aerofox
帖子: 1453
注册时间: 2008-05-24 8:30

#3

帖子 aerofox » 2008-09-13 15:04

确认一下你启动 gnome-terminal 后第一个 shell 是不是 bash:

代码: 全选

echo $0
delectate
帖子: 18311
注册时间: 2008-01-09 22:41

#4

帖子 delectate » 2008-09-13 16:21

aerofox 写了:确认一下你启动 gnome-terminal 后第一个 shell 是不是 bash:

代码: 全选

echo $0
这事关键

否则都成了dir效果了
头像
HuntXu
帖子: 5776
注册时间: 2007-09-29 3:09

#5

帖子 HuntXu » 2008-09-13 16:22

代码: 全选

[hunt@bubble ~]$ O_< type ls
ls is aliased to `ls --color=auto'
HUNT Unfortunately No Talent...
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#6

帖子 eexpress » 2008-09-13 21:29

一种方法
#LS_COLORS='no=00:fi=00:di=01;34:ln=01;35:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;33:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:';
#export LS_COLORS

二种方法
eval `dircolors ~/.exp_ls_colors`

☎ cat ~/.exp_ls_colors
# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM linux-c
TERM mach-color
。。。。
.tar 00;31
.tgz 00;31
.arj 00;31
.taz 00;31
.lzh 00;31
.zip 00;31
.z 00;31
.Z 00;31
.gz 00;31
。。。
● 鸣学
Arthur19891106
帖子: 30
注册时间: 2008-04-30 19:57
来自: http://godorz.cn
联系:

#7

帖子 Arthur19891106 » 2008-09-14 0:50

想3楼学习
头像
linuxier
帖子: 317
注册时间: 2008-05-27 10:45
联系:

#8

帖子 linuxier » 2008-09-16 23:06

echo $0
显示是用的bash啊,
aerofox 写了:确认一下你启动 gnome-terminal 后第一个 shell 是不是 bash:

代码: 全选

echo $0
回复