Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm a Centos user and have just started my first Debian install. In Centos the ls command lists output in color to indicate whether an item is a file, directory, symlink and if a file/directory is world-writable.

Here's an example...

Centos directory listing in color

How can I enable this color display in Debian? Thanks

share|improve this question

2 Answers 2

up vote 12 down vote accepted
alias ls='ls --color=auto'

Put it in your .bashrc

Or if you prefer create a file in your profile named .bash_aliases and put there your alias (by default in debian's .bashrc that gets sourced)

share|improve this answer
    
Thanks - that worked! –  Xoundboy Sep 24 '11 at 18:08
1  
@Xoundboy If it worked, mark it as an answer –  Wesley Sep 24 '11 at 18:56
    
I tried before but it said I couldn't mark it as an answer for another 8 minutes! I only just got chance to come back –  Xoundboy Sep 24 '11 at 20:12

Under Debian and derivatives (example: raspbian for Raspberry Pi), if you edit the /root/.bashrc file you'll find some line commented about "ls colorization". Just uncomment them and run "source /root/.bashrc" or relogin:

# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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