您的位置:首页 > 运维架构 > Shell

解决debian linux用xshell 登陆在命令行终端显示彩色的文件及文件夹

2017-03-16 00:00 351 查看
最近公司开了一个服务器,用的是debian 8的linux系统,用xshell登陆总是显示不出文件与文件夹的区别,还不习惯也不方, 经过研究发现默认没有启用。本文借用了网上关于debian6的设置方式,发现是可行的。区别在于/root/.bashrc文件的前几行,虽然文件内容有区别,但操作方式没有区别。下面分别贴出debian6与debian8的.bashrc文件需要修改的地方。

编辑.bashrc 文件,去掉红色标记前的#号,退出再登陆就在回熟悉的界面了!

vim /root/.bashrc

================debian8================

# ~/.bashrc: executed by bash(1) for non-login shells.

# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
umask 022

# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'

================debian6================

# ~/.bashrc: executed by bash(1) for non-login shells.

#export PS1='h:w$ '

export PS1='[33[1;32;40m]u@h:w$ [33[0m]'

umask 022

# You may uncomment the following lines if you want `ls' to be colorized:

export LS_OPTIONS='--color=auto'

eval "`dircolors`"

alias ls='ls $LS_OPTIONS'

alias ll='ls $LS_OPTIONS -l'

alias l='ls $LS_OPTIONS -lA'

#

# Some more alias to avoid making mistakes:

# alias rm='rm -i'

# alias cp='cp -i'

# alias mv='mv -i'

本文出自 “忘不了” 博客,请务必保留此出处http://06071124.blog.51cto.com/1637678/630812
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息