关于cli:现代化命令行工具之Ubuntu-2004qbit

37次阅读

共计 1345 个字符,预计需要花费 4 分钟才能阅读完成。

批量配置

  • 繁难的 shell 脚本:https://github.com/qbit-git/m…

    bash modern_cli_ubuntu2004.sh
  • 本脚本实用于与有 root/sudo 权限应用
  • 本脚本实用于初始化,没做条件判断,不适用于简单情景

工具

rg 替换 grep

  • 编程语言:Rust
  • GitHub:https://github.com/BurntSushi…
  • 装置与配置

    sudo apt install ripgrep -y
    # 上面一句是防止与下文介绍的 bat 抵触
    sudo sed -i '/\/usr\/.crates2.json/d' /var/lib/dpkg/info/ripgrep.list
    echo 'alias grep=rg' >> ~/.bashrc

bat 替换 cat

  • 编程语言:Rust
  • GitHub:https://github.com/sharkdp/bat
  • 装置与配置

    sudo apt install bat -y
    echo 'alias cat=batcat' >> ~/.bashrc 

fd 替换 find

  • 编程语言:Rust
  • GitHub:# https://github.com/sharkdp/fd

    sudo install fd-find -y
    echo 'alias fd=fdfind' >> ~/.bashrc 
    echo 'alias find="fdfind -H"' >> ~/.bashrc 

fzf 命令行含糊匹配

  • 编程语言:Go
  • GitHub:https://github.com/junegunn/fzf

    sudo apt install fzf
    echo 'source /usr/share/doc/fzf/examples/completion.bash' >> ~/.bashrc 
    echo 'source /usr/share/doc/fzf/examples/key-bindings.bash' >> ~/.bashrc

pipx

  • 编程语言:Python
  • GitHub:https://github.com/pypa/pipx
  • 装置与配置

    pip3 install pipx
    echo 'export PATH=$PATH:/home/ubuntu/.local/bin' >> ~/.bashrc

tldr

  • 编程语言:Python
  • GitHub: https://github.com/tldr-pages…
  • 装置与配置

    pipx install tldr
    tldr -u

glances 替换 top

  • 编程语言:Python
  • GitHub: https://github.com/nicolargo/…
  • 装置与配置

    pipx install glances
    mkdir .config/glances/
    cp .local/pipx/venvs/glances/share/doc/glances/glances.conf .config/glances/glances.conf

xonsh 基于 Python 的 shell

  • 编程语言:Python
  • GitHub: https://github.com/xonsh/xonsh
  • 装置与配置

    pipx install xonsh[full] -i https://mirrors.aliyun.com/pypi/simple/
    aliases['ll'] = 'ls -al'

本文出自 qbit snap

正文完
 0