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 --all
copy

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

Only list directories
$ colorls --dirs
copy

SYNOPSIS

colorls [options] [file...]

PARAMETERS

-a, --all
    Show all files, including hidden files (starting with '.').

-l, --long
    Display output in long listing format (similar to `ls -l`).

-h, --human-readable
    Display file sizes in human-readable format (e.g., 1K, 234M, 2G).

-d, --dirs
    List directories as files, not contents.

-t, --sort-time
    Sort by modification time, newest first.

-r, --reverse
    Reverse the order of the sort.

-S, --sort-size
    Sort by file size, largest first.

-1, --oneline
    List one file per line.

--gs, --git-status
    Display git status for files and directories.

--no-git
    Disable git integration.

--icons [theme]
    Specify the icon theme to use (e.g., 'nerd-font', 'font-awesome').

--no-icons
    Disable icons.

--colors [theme]
    Specify the color theme to use.

--no-colors
    Disable colorization.

--hyperlink
    Makes the output filenames hyperlinks for terminal emulators that support them.

--config-file PATH
    Path of custom configuration file.

-v, --version
    Show version.

-H, --help
    Display this help message.

DESCRIPTION

colorls is a Ruby gem that provides a visually enhanced and more informative alternative to the standard `ls` command in Linux and macOS. It adds color coding based on file type, icons to visually represent file types (using Nerd Fonts by default), and displays extended file information such as file size, modified date, and permissions in a more readable format. It also supports Git integration, displaying Git status indicators for files and directories in a Git repository. The goal is to improve the user experience by making it easier to visually scan and understand the contents of a directory. colorls aims to be highly configurable, allowing users to customize the color scheme, icons, and displayed information. Its simple installation via RubyGems makes it easily available to anyone comfortable with using CLI tools.

CAVEATS

Relies on Ruby and the colorls gem being installed. Icon display requires a compatible font (e.g., a Nerd Font) to be configured in your terminal.

INSTALLATION

colorls can be installed using RubyGems:
gem install colorls
Ensure Ruby and RubyGems are installed on your system prior to attempting installation.

CONFIGURATION

colorls can be configured using a configuration file (default location is `~/.config/colorls/config.yaml`). This file allows customizing colors, icons, and other settings.
Example:
mkdir -p ~/.config/colorls
colorls --dump-config > ~/.config/colorls/config.yaml
Then edit your configuration file.

HISTORY

colorls emerged as a popular alternative to the standard `ls` command, driven by the desire for a more visually appealing and informative directory listing. Developed as an open-source project and distributed as a Ruby gem, it gained traction for its ease of installation and customizability. The use of color, icons, and Git status indicators significantly improved the user experience, leading to widespread adoption among developers and other users who frequently interact with the command line.

SEE ALSO

ls(1), tree(1)

Copied to clipboard