ls

This is a wiki page. Be bold and improve it!

If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.

Change default colors

If you want to change the colours in the coloured output of ls, e.g. to get rid of the flashing red for broken symlinks1, do:

$ dircolors --print-database > ~/.dircolors

Change the following two files:

~/.bashrc

# Change the color for a broken symlink flashing red
# http://linux.overshoot.tv/ticket/6154 
d=~/.dircolors
test -r $d && eval "$(dircolors $d)"

Edit ~/.dircolors and change what you want. Remove the '05' in the following two lines to get rid of the flashing colour:

ORPHAN 01;37;41 # orphaned syminks
MISSING 01;37;41 # ... and the files they point to

globbing

The command ls does not use regexp to match patterns, but glob.
Thus the command ls [A-Z]* will not give the expected results (listing files starting with an upper case letter.
The proper command would be: ls [[:upper]]*

See:

$ man 7 glob

  • 1. A symlink to a file in an un-mounted external drive will be 'broken' without it constituting an actual error.

Issues related to this page:

ProjectSummaryStatusPriorityCategoryLast updatedAssigned to
Linux softwareNo menu in node `(coreutils.info.bz2)coreutils …activeminorbug report8 years 7 weeks
Linux DistributionHow to change the color for a broken symlink fl…activenormalsupport request8 years 7 weeks
Linux software /etc/ # grep -r dircolors *activenormalfeature request8 years 7 weeks