We help IT Professionals succeed at work.

Linux Files and Folders distinction

jskfan
jskfan asked
on
Linux Files and Folders distinction


on the screenshot below, I noticed Folders have different colors, I am not sure what 's the reason:
The blue and light blue are folders.
the ones with .extension are files, they are either green or just plain white on black

I was just wondering if there is any Rules about  that .

Thank you

a
Comment
Watch Question

Simple Geek from the '70s
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
Blue: Directory
Green: Executable or recognized data file
Sky Blue: Symbolic link file
Yellow with black background: Device
Pink: Graphic image file
Red: Archive file
Red with black background: Broken link
Uncolored (white): file or non-filename text (e.g. permissions in the output of ls -l)
Bold blue: directory
Bold cyan: symbolic link
Bold green: executable file
Bold red: archive file
Bold magenta: image file, video, graphic, etc. or door or socket
Cyan: audio file
Yellow with black background: pipe (AKA FIFO)
Bold yellow with black background: block device or character device
Bold red with black background: orphan symlink or missing file
Uncolored with red background: set-user-ID file
Black with yellow background: set-group-ID file
Black with red background: file with capability
White with blue background: sticky directory
Blue with green background: other-writable directory
Black with green background: sticky and other-writable directory

Open in new window


dircolors -p |less
nociSoftware Engineer
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
The colors are selectables and are stored in the environment variable: LS_COLORS,  colors can be disabled   --colors=never or --colors=always default is --colors=auto meaning if stdout is a tty  coloring will be done and through pipelines it isnt.    ls | cat    will remove colors.
Besides coloring ls can also add suffixes to filenames..  (ls -F   or classify files).

Folder/
Symbolic-link@
etc.

You can find more in:  man ls

Author

Commented:
Thank you Guys!