LinuxCommandLibrary

colorls

List directory contents with colors and icons

TLDR

List files one per line

$ colorls -1
copy

List all files, including hidden files
$ colorls [[-a|--all]]
copy

Long format list (permissions, ownership, size, and modification date) of all files
$ colorls [[-l|--long]] [[-a|--all]]
copy

Only list directories
$ colorls [[-d|--dirs]]
copy

SYNOPSIS

colorls [OPTION]... [FILE]...

PARAMETERS

-a, --all
    Include hidden files (dotfiles)

-l
    Long format with permissions, owner, size, time

-h
    Human-readable file sizes (e.g., 1.2G)

--tree[=DEPTH]
    Tree view of directory structure

--git-status
    Show Git branch and status (staged/untracked)

--dark
    Force dark theme

--light
    Force light theme

--ansi
    Use ANSI 16-color mode

--icon
    Display file icons (requires Nerd Fonts)

--almost-all
    List all except . and ..

-1
    One entry per line

--sort=SORT_FIELD
    Sort by extension, size, time, etc.

DESCRIPTION

colorls is a Ruby-based command-line tool that supercharges the traditional Unix ls command with vibrant colors, file type icons, and Git repository integration. It categorizes files and directories by type (e.g., executables in green, directories in blue), permissions, and modifications, making it easier to scan contents at a glance.

Key highlights include:
Visual enhancements: Color-coded output, Unicode icons (via Nerd Fonts), and compact or detailed views.
Git awareness: Displays branch names, staged/unstaged changes, and untracked files inline.
Theme support: Automatic or manual switching between dark/light modes.
ls compatibility: Supports most standard ls flags like -l, -a, -h for seamless transition.

Ideal for developers and power users in terminals supporting 256 colors or truecolor. Install via gem install colorls; it's lightweight and extensible. Output is more informative than plain ls without overwhelming verbosity, boosting productivity in project directories.

CAVEATS

Requires Ruby <= 3.x and gem install colorls; not pre-installed. Icons need Nerd Fonts. Git features only in repositories. Truecolor support varies by terminal.

INSTALLATION

gem install colorls. Alias ls to colorls in shell config (e.g., alias ls='colorls')

DEPENDENCIES

Ruby, Nerd Fonts for icons, Git for status. Works on Linux/macOS; limited Windows support via WSL.

HISTORY

Developed by Athenna (GitHub: athenna/colorls), first released in 2017. Gained traction as a simple, Ruby-powered ls alternative amid rise of modern listers like exa. Actively maintained with theme and font improvements; over 5k stars on GitHub.

SEE ALSO

ls(1), exa(1), lsd(1), tree(1)

Copied to clipboard