Colorize Mac 'ls' output | PROGRAMMING INTERVIEWS
Since I have switched to Mac, I was wondering how to colorize the 'ls' output for it. I really like having color output when I use the ls command. This enables me to quick scan filetypes in a jiffy. In unix you can do this by giving '-color' option with ls but unfortunately that doesn't work with Mac. Apple has chnaged this option from '-color' to '-G'. So next time you want to see the colored ls output on your mac terminal, simple append below line in your .profile.
alias ls="ls -G"
You can also choose what color (foreground/background and bold/normal) you want for your specific file type. For this you need to set LSCOLORS variable as your choice. I use following LSCOLORS in my .profile:
export LSCOLORS=dxfxcxdxbxegedabagaca
Read full article from Colorize Mac 'ls' output | PROGRAMMING INTERVIEWS
No comments:
Post a Comment