Color your Bash

Missing a little color in your Bash shell under Cygwin? Fear not! Just edit the .bashrc file in your home directory. Just uncomment the following lines:

alias ls='ls -hF --color=tty' # classify files in colour
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'

Also, if you don’t like that each Bash command uses two lines then edit /etc/bash.bashrc. There’s a line that starts with PS1 and it looks like this:

PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n$ '

Change it to:

PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\040\$ '

Change the last “\n” to “\040”, instead of starting on a new line it adds a space.

And voila! 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s