Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

As a linux user, I spend a lot of time mucking about in bash. I've always been a bit frustrated by how poor the readability is.

Today this annoyed me enough to spur me into action. My immediate problem was solved by this snippet, which changes the directories colour to magenta. (Annoyingly, this caused me to lose all the other ls colours.)

So I started wondering, what other tweaks exists to make bash a bit more readable?

share|improve this question

migrated from serverfault.com Nov 21 '11 at 14:26

This question came from our site for professional system and network administrators.

closed as not constructive by Michael Mrozek Nov 21 '11 at 16:39

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Maybe better on SuperUser? That aside, get a decent font for starters. Look for a font with a line height ~120% (0.2 of a line gap), makes it much more readable. In Gnome Terminal go to Edit->Profiles to change that stuff, I'm sure there's an equivalent in most other terminals but I mainly work with the Gnome one –  sam Nov 21 '11 at 14:08
    
The readability is what you set it to be. Nothing to get frustrated about, just configure to your liking. –  rozcietrzewiacz Nov 21 '11 at 14:47
    
@rozcietrzewiacz That's kinda the point of my question. I'm not blaming bash. I want to know how people have configured it to their liking. –  Tom Wright Nov 21 '11 at 15:28
1  
If you come up with a specific attribute you want to change we can go with that, but "what stuff do you do to make bash readable" is massively broad –  Michael Mrozek Nov 21 '11 at 16:39

2 Answers 2

Maybe Solarized? http://ethanschoonover.com/solarized

There's a bunch of projects that do similar terminal colorization schemes with an eye to usability.

share|improve this answer
    
Nice find! I'm going to try this. –  ewwhite Nov 21 '11 at 14:25
    
Works really nicely with PuTTY. +1 –  Tom Wright Nov 21 '11 at 15:42

The other colors in ls output were gone, because the blog post you refer to gives really poor instructions. If you set LS_COLORS to 'di=0;35', then you've just instructed ls to color only directories. Remove that setting from your .bashrc, re-login in another terminal and do

echo "$LS_COLORS"

You'll probably see a long set of color settings. Here's what I have:

LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:\
bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:\
ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:\
*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:\
*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:\
*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:\
*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:\
*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=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:\
*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:\
*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:\
*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:\
*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:\
*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:\
*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:\
*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:\
*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:\
*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:\
*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36"

The useful property of that variable is that if you define a color more than once, the last setting will override any previous. So if you just want to change the color for displaying directories to magenta, do

export LS_COLORS="${LS_COLORS%:}:di=01;35:"

(A colon is used to separate settings.)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.