← 返回命令列表

Linux command

lsd 命令

文件

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

常用示例

List files

lsd

List with long format

lsd -l

List all

lsd -la

Display as a tree

lsd --tree --depth [3]

Sort by file size

lsd -lS --reverse

List with git status

lsd -l --git

Group directories first

lsd -l --group-directories-first

List with total directory sizes

lsd -l --total-size

说明

lsd (LSDeluxe) is a modern replacement for the `ls` command written in Rust. It adds colors, file-type icons, and tree view to directory listings while remaining compatible with standard `ls` flags. The tool supports Nerd Font icons for visual file-type identification, git integration to display repository status alongside files, and extensive customization through a YAML configuration file.

参数

-a, --all
Include hidden files (starting with `.`).
-A, --almost-all
Include hidden files but exclude `.` and `..`.
-l, --long
Display extended file metadata in long format.
-1, --oneline
Display one entry per line.
-R, --recursive
Recurse into directories.
--tree
Display directory contents as a tree structure.
--depth _num_
Limit the depth of recursion (used with `--tree` or `-R`).
-t, --timesort
Sort by modification time.
-S, --sizesort
Sort by file size.
-X, --extensionsort
Sort by file extension.
-v, --versionsort
Natural sort of version numbers within filenames.
--sort _WORD_
Sort by: size, time, version, extension, or git.
-r, --reverse
Reverse the sort order.
-U, --no-sort
Do not sort; list entries in directory order.
--git
Show git status for listed files and directories.
--color _WHEN_
Control color output: always, auto, or never (default: auto).
--icon _WHEN_
Control icon display: always, auto, or never (default: auto).
--icon-theme _THEME_
Icon theme: fancy or unicode (default: fancy).
--group-dirs _VALUE_
Group directories: none, first, or last.
--group-directories-first
List directories before files (shorthand for `--group-dirs=first`).
--date _FORMAT_
Date display format: date, locale, relative, or a custom format string.
--size _FORMAT_
Size display format: default, short, or bytes.
--permission _FORMAT_
Permission display format: rwx, octal, attributes, or disable.
--total-size
Display total size of directories, not just immediate entry count.

FAQ

What is the lsd command used for?

lsd (LSDeluxe) is a modern replacement for the `ls` command written in Rust. It adds colors, file-type icons, and tree view to directory listings while remaining compatible with standard `ls` flags. The tool supports Nerd Font icons for visual file-type identification, git integration to display repository status alongside files, and extensive customization through a YAML configuration file.

How do I run a basic lsd example?

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

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

Include hidden files (starting with `.`).