命令行美化@跨平台的ls列举文件目录着色工具@现代化软件eza@exa

abstract

  • eza is a modern, maintained replacement for the venerable file-listing command-line program ls that ships with Unix and Linux operating systems, giving it more features and better defaults. It uses colours to distinguish file types and metadata. It knows about symlinks, extended attributes, and Git. And it’s small, fast, and just one single binary.

    By deliberately making some decisions differently, eza attempts to be a more featureful, more user-friendly version of ls.

eza项目地址

下载和安装

linux

refs

Notes

  • linux不同发行版可以有不同的安装方法
  • 其中Cargo是通用的linux安装方式,但是需要提前安装Rust Cargo 环境

FAQ

  • 对于deb/ubuntu系的,先预备安装sudo apt install build-essential,以免后续编译失败

  • 安装Cargo的时候先设置两个环境变量换为国内源加速:

    • export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
      export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
      
  • 详情查看上述refs中的第一个链接

windows

  • 安装比较简单,使用winget,scoop 都可以(可能需要代理)

效果👺

  • PS>eza --icons -ghilTL 2
    Mode  Size Date Modified Name
    d----    - 18 Mar 19:34   .
    -a--- 331k 18 Mar 18:59  ├──  20240318_185950.mp4
    -a--- 1.2M 18 Mar 19:10  ├──  20240318_191010.mp4
    d----    - 10 Mar 23:22  ├──  ansel
    d-r--    - 18 Mar 19:34  ├── 󰉌 Contacts
    d-r--    - 18 Mar 19:36  ├──  Desktop
    -a--- 1.4k 17 Jan 10:31  │  ├──  blogs_home.lnk
    -a--- 1.4k 19 Jan 14:15  │  ├──  EM.lnk
    -a--- 1.4k 19 Jan 14:14  │  ├──  math.lnk
    -a--- 1.4k 17 Jan 10:33  │  ├──  neep.lnk
    -a---  44k 15 Mar 20:13  │  └──  四边形加固为刚性结构.ggb
    d-r--    - 18 Mar 19:34  ├──  Documents
    d----    - 18 Mar 18:22  │  ├──  Apowersoft
    d----    - 18 Mar 18:03  │  ├──  Captura
    
  • /mnt/c/Users/cxxu/Desktop  $ eza --icons -ghilTL 2                   
               inode Permissions Size User    Group   Date Modified Name
    1125899907235745 drwxrwxrwx     - ubtcxxu ubtcxxu 18 Mar 19:36   .
     281474976901038 .rwxrwxrwx  1.4k ubtcxxu ubtcxxu 17 Jan 10:31  ├──  blogs_home.lnk
     844424930203848 .rwxrwxrwx   282 ubtcxxu ubtcxxu 18 Mar 19:34  ├──  desktop.ini
     281474976901039 .rwxrwxrwx  1.4k ubtcxxu ubtcxxu 19 Jan 14:15  ├──  EM.lnk
     281474976901040 .rwxrwxrwx  1.4k ubtcxxu ubtcxxu 19 Jan 14:14  ├──  math.lnk
     281474976901041 .rwxrwxrwx  1.4k ubtcxxu ubtcxxu 17 Jan 10:33  ├──  nee
    

其他项目

exa(deprecated)

较新版本的linux发行版上安装exa
  • sudo apt install exa
    • 譬如 ubuntu 21/kali rolling
安装流程(手动通用安装:包括较老版本)
curl https://sh.rustup.rs -sSf | sh

# Till the date of publication of this article, the latest available download version is the 0.8.0

wget -c https://github.com/ogham/exa/releases/download/v0.8.0/exa-linux-x86_64-0.8.0.zip
#upzip the tool
unzip exa-linux-x86_64-0.8.0.zip

# Move the unziped binary with the name "exa-linux-x86_64" to "/usr/local/bin/" with the exa name
# so that we can use the program name`exa`directly
sudo mv exa-linux-x86_64 /usr/local/bin/exa

ls-icons

powershell上的其他ls美化工具

posted @ 2022-04-11 11:01  xuchaoxin1375  阅读(78)  评论(0)    收藏  举报  来源