ls 命令现代化替代方案

admin 2024年6月20日17:26:33评论33 views字数 9551阅读31分50秒阅读模式
ls 命令现代化替代方案

简介 🧐

EZA

  • 项目地址:https://github.com/eza-community/eza

LSD

  • 项目地址:https://github.com/lsd-rs/lsd

安装 🤭

  • apt install lsd eza
  • pacman -S lsd eza
  • brew install lsd eza
  • winget search lsd eza
  • dnf install lsd eza

使用 😧

ls 命令现代化替代方案

参数选项

eza

❯ eza --help
Usage:
  eza [options] [files...]

META OPTIONS
  --help                     show list of command-line options
  -v, --version              show version of eza

DISPLAY OPTIONS
  -1, --oneline              display one entry per line
  -l, --long                 display extended file metadata as a table
  -G, --grid                 display entries as a grid (default)
  -x, --across               sort the grid across, rather than downwards
  -R, --recurse              recurse into directories
  -T, --tree                 recurse into directories as a tree
  -X, --dereference          dereference symbolic links when displaying information
  -F, --classify=WHEN        display type indicator by file names (always, auto, never)
  --colo[u]r=WHEN            when to use terminal colours (always, auto, never)
  --colo[u]r-scale           highlight levels of 'field' distinctly(all, age, size)
  --colo[u]r-scale-mode      use gradient or fixed colors in --color-scale (fixed, gradient)
  --icons=WHEN               when to display icons (always, auto, never)
  --no-quotes                don't quote file names with spaces
  --hyperlink                display entries as hyperlinks
  --absolute                 display entries with their absolute path (on, follow, off)
  -w, --width COLS           set screen width in columns

FILTERING AND SORTING OPTIONS
  -a, --all                  show hidden and '
dot' files. Use this twice to also
                             show the '
.' and '..' directories
  -A, --almost-all           equivalent to --all; included for compatibility with `ls -A`
  -d, --list-dirs            list directories as files; don'
t list their contents
  -L, --level DEPTH          limit the depth of recursion
  -r, --reverse              reverse the sort order
  -s, --sort SORT_FIELD      which field to sort by
  --group-directories-first  list directories before other files
  -D, --only-dirs            list only directories
  -f, --only-files           list only files
  -I, --ignore-glob GLOBS    glob patterns (pipe-separated) of files to ignore
  --git-ignore               ignore files mentioned in '.gitignore'
  Valid sort fields:         name, Name, extension, Extension, size, type,
                             modified, accessed, created, inode, and none.
                             date, time, old, and new all refer to modified.

LONG VIEW OPTIONS
  -b, --binary               list file sizes with binary prefixes
  -B, --bytes                list file sizes in bytes, without any prefixes
  -g, --group                list each file's group
  --smart-group              only show group if it has a different name from owner
  -h, --header               add a header row to each column
  -H, --links                list each file'
s number of hard links
  -i, --inode                list each file's inode number
  -m, --modified             use the modified timestamp field
  -M, --mounts               show mount details (Linux and Mac only)
  -n, --numeric              list numeric user and group IDs
  -O, --flags                list file flags (Mac, BSD, and Windows only)
  -S, --blocksize            show size of allocated file system blocks
  -t, --time FIELD           which timestamp field to list (modified, accessed, created)
  -u, --accessed             use the accessed timestamp field
  -U, --created              use the created timestamp field
  --changed                  use the changed timestamp field
  --time-style               how to format timestamps (default, iso, long-iso,
                             full-iso, relative, or a custom style '
+<FORMAT>'
                             like '+%Y-%m-%d %H:%M')
  --total-size               show the size of a directory as the size of all
                             files and directories inside (unix only)
  --no-permissions           suppress the permissions field
  -o, --octal-permissions    list each file's permission in octal format
  --no-filesize              suppress the filesize field
  --no-user                  suppress the user field
  --no-time                  suppress the time field
  --stdin                    read file names from stdin, one per line or other separator
                             specified in environment
  --git                      list each file's Git status, if tracked or ignored
  --no-git                   suppress Git status (always overrides --git,
                             --git-repos, --git-repos-no-status)
  --git-repos                list root of git-tree status
  -@, --extended             list each file's extended attributes and sizes
  -Z, --context              list each file's security context

lsd

❯ lsd --help
An ls command with a lot of pretty colors and some other stuff.

Usage: lsd [OPTIONS] [FILE]...

Arguments:
  [FILE]...  [default: .]

Options:
  -a, --all                          Do not ignore entries starting with
  -A, --almost-all                   Do not list implied . and ..
      --color <MODE>                 When to use terminal colours [default: auto] [possible values: always, auto, never]
      --icon <MODE>                  When to print the icons [default: auto] [possible values: always, auto, never]
      --icon-theme <THEME>           Whether to use fancy or unicode icons [default: fancy] [possible values: fancy, unicode]
  -F, --classify                     Append indicator (one of */=>@|) at the end of the file names
  -l, --long                         Display extended file metadata as a table
      --ignore-config                Ignore the configuration file
      --config-file <PATH>           Provide a custom lsd configuration file
  -1, --oneline                      Display one entry per line
  -R, --recursive                    Recurse into directories
  -h, --human-readable               For ls compatibility purposes ONLY, currently set by default
      --tree                         Recurse into directories and present the result as a tree
      --depth <NUM>                  Stop recursing into directories after reaching specified depth
  -d, --directory-only               Display directories themselves, and not their contents (recursively when used with --tree)
      --permission <MODE>            How to display permissions [default: rwx for linux, attributes for windows] [possible values: rwx, octal, attributes, disable]
      --size <MODE>                  How to display size [default: default] [possible values: default, short, bytes]
      --total-size                   Display the total size of directories
      --date <DATE>                  How to display date [default: date] [possible values: date, locale, relative, +date-time-format]
  -t, --timesort                     Sort by time modified
  -S, --sizesort                     Sort by size
  -X, --extensionsort                Sort by file extension
  -G, --gitsort                      Sort by git status
  -v, --versionsort                  Natural sort of (version) numbers within text
      --sort <TYPE>                  Sort by TYPE instead of name [possible values: size, time, version, extension, git, none]
  -U, --no-sort                      Do not sort. List entries in directory order
  -r, --reverse                      Reverse the order of the sort
      --group-dirs <MODE>            Sort the directories then the files [possible values: none, first, last]
      --group-directories-first      Groups the directories at the top before the files. Same as --group-dirs=first
      --blocks <BLOCKS>              Specify the blocks that will be displayed and in what order [possible values: permission, user, group, context, size, date, name, inode, links, git]
      --classic                      Enable classic mode (display output similar to ls)
      --no-symlink                   Do not display symlink target
  -I, --ignore-glob <PATTERN>        Do not display files/
directories with names matching the glob pattern(s). More than one can be specified by repeating the argument
  -i, --inode                        Display the index number of each file
  -g, --git                          Show git status on file and directory" Only when used with --long option
  -L, --dereference                  When showing file information for a symbolic link, show information for the file the link references rather than for the link itself
  -Z, --context                      Print security context (label) of each file
      --hyperlink <MODE>             Attach hyperlink to filenames [default: never] [possible values: always, auto, never]
      --header                       Display block headers
      --truncate-owner-after <NUM>   Truncate the user and group names if they exceed a certain number of characters
      --truncate-owner-marker <STR>  Truncation marker appended to a truncated user or group name
  -N, --literal                      Print entry names without quoting
      --help                         Print help information
  -V, --version                      Print version

Refences 😜

  • https://github.com/lsd-rs/lsd
  • https://github.com/eza-community/eza

原文始发于微信公众号(人遁安全):ls 命令现代化替代方案

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年6月20日17:26:33
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   ls 命令现代化替代方案https://cn-sec.com/archives/2866703.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息