← 返回命令列表

Linux command

colorls 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

List files

colorls

List all files

colorls -a

List in long format

colorls -l

List with directory tree view

colorls --tree

Sort by modification time

colorls -t

List only directories

colorls -d

List only files

colorls -f

Show file sizes

colorls -lh

说明

colorls is a Ruby gem that provides an enhanced, colorful alternative to the standard ls command. It displays file listings with icons (using Nerd Fonts), colors based on file type, and additional features like git status integration and tree views. Each file type is represented by a distinct icon and color: directories, executables, images, documents, archives, and more. This visual differentiation makes it easier to scan directory contents quickly. The icons require a Nerd Font (patched font with icons) to display correctly. Git integration shows the status of files in repositories: modified, staged, untracked, etc. The tree view provides a hierarchical display of directory structure similar to the tree command but with colorls styling. Configuration can be customized via ~/.config/colorls/dark_colors.yaml and ~/.config/colorls/light_colors.yaml for colors, and ~/.config/colorls/file_aliases.yaml for custom file type associations.

参数

-a, --all
Show hidden files (starting with .).
-l, --long
Display long format with permissions, owner, size, and date.
-r, --reverse
Reverse sort order.
-t, --sort-time
Sort by modification time (newest first).
-d, --dirs
Show only directories.
-f, --files
Show only files.
-s, --sort-size
Sort by file size.
-1
One entry per line.
--tree _depth_
Show directory tree (optional depth limit).
--report, --r
Show brief report of files and directories.
--gs, --git-status
Show git status for each file.
--sd, --sort-dirs
Sort directories first.
--sf, --sort-files
Sort files first.
-h, --human-readable
Show file sizes in human-readable format (K, M, G).
--light
Use light color scheme.
--dark
Use dark color scheme (default).
--help
Display help information.

FAQ

What is the colorls command used for?

colorls is a Ruby gem that provides an enhanced, colorful alternative to the standard ls command. It displays file listings with icons (using Nerd Fonts), colors based on file type, and additional features like git status integration and tree views. Each file type is represented by a distinct icon and color: directories, executables, images, documents, archives, and more. This visual differentiation makes it easier to scan directory contents quickly. The icons require a Nerd Font (patched font with icons) to display correctly. Git integration shows the status of files in repositories: modified, staged, untracked, etc. The tree view provides a hierarchical display of directory structure similar to the tree command but with colorls styling. Configuration can be customized via ~/.config/colorls/dark_colors.yaml and ~/.config/colorls/light_colors.yaml for colors, and ~/.config/colorls/file_aliases.yaml for custom file type associations.

How do I run a basic colorls example?

Run `colorls` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --all do in colorls?

Show hidden files (starting with .).