cygwin 命令别名及不同文件类型显示不同的颜色

﹏ヽ暗。殇╰゛Y 2022-01-21 09:27 480阅读 0赞

正常情况下,我们的cygwin安装好之后,不管是文件还是文件夹显示的颜色都是一样的,这样在我们平时的工作中很不方便

所以这里记录一下怎么设置成彩色的,其实很简单。

原来的样子

20190609154252823.png

直接修改文件 .bashrc

vim .bashrc 里面的内容如下:

# Default to human readable figures
alias df=’df -h’
alias du=’du -h’
#
# Misc :)
alias less=’less -r’ # raw control characters
alias whence=’type -a’ # where, of a sort
alias grep=’grep —color’ # show differences in colour
alias egrep=’egrep —color=auto’ # show differences in colour
alias fgrep=’fgrep —color=auto’ # show differences in colour
#
# Some shortcuts for different directory listings
alias ls=’ls -hF —color=tty’ # classify files in colour
alias dir=’ls —color=auto —format=vertical’
alias vdir=’ls —color=auto —format=long’
alias ll=’ls -l’ # long list
alias la=’ls -A’ # all but . and ..
alias l=’ls -CF’ #
直接把 alias ls=’ls -hF —color=tty’ 注释打开即可

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjQ2NTEyNQ_size_16_color_FFFFFF_t_70

最后执行一下

source .bashrc 就好了

现在的样子

20190609154316364.png

发表评论

表情:
评论列表 (有 0 条评论,480人围观)

还没有评论,来说两句吧...

相关阅读