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! 🙂



If you’re like me and:
1) want to keep using Linux commands on Windows
2) want to learn/remember more Linux commands
3) hate using DOS commands

then install Cygwin! So what is Cygwin?? Quoting from their website “a collection of tools which provide a Linux look and feel environment for Windows“.

Yep it feels good to use “ls” on Windows 🙂