cli-cheatsheets 是一个集中化的命令行工具速查表仓库,通过简单的 Shell 脚本,快速查询和查看各种常用命令速查表。
贡献者可在 AGENTS.md 中查看最新的仓库协作规范与工作流指引。
- 丰富的速查表: 涵盖 Android, Build Tools, CLI Tools, Cloud Tools, Container Tools, Data Process Tools, Database, Media, Network, Notification, OS Commands, Package Managers, Runtime, Security, Tools, Version Control, Web Servers 等 17 个类别,共 155+ 个速查表,持续更新和扩充。
- 快速查询: 通过简单的命令即可查看指定工具的速查表。
- 别名支持: 方便配置 Bash/Zsh/Fish 别名,实现更快速的调用。
- 简单易用: 脚本简洁明了,操作简单直观。
- 多系统支持: 兼容 Linux 和 macOS 系统。
- 配置别名 (可选): 为了更快速地调用速查表,建议配置 Shell 别名。
- 远程使用: 无需下载项目,直接通过
curl命令远程执行脚本。 - 本地使用: 下载项目后,赋予执行权限并运行脚本。
直接使用 curl 命令远程执行脚本:
curl https://cs.yycc.dev | bash -s -- git
# 或者 显示所有支持的命令速查表
curl https://cs.yycc.dev | bash -s -- -l或者使用 wget 命令:
wget -qO- https://cs.yycc.dev | bash -s -- git以上
URL是一个短地址,实际指向的是/get-cheatsheet.sh,你可以在分支gh-pages中找到它。 你也可以直接使用https://raw.githubusercontent.com/funnyzak/cli-cheatsheets/main/cheatsheet.sh进行远程执行。 国区可以使用Gitee的镜像地址:https://gitee.com/funnyzak/cli-cheatsheets/raw/main/cheatsheet.sh。
为了更快速地调用速查表,建议配置 Shell 别名。
将以下代码添加到你的 ~/.bashrc 或 ~/.zshrc 文件中:
alias cs='() { curl -s https://raw.githubusercontent.com/funnyzak/cli-cheatsheets/refs/heads/main/cheatsheet.sh | bash -s -- "$@" }'Gitee 镜像地址:
alias cs='() { curl -s https://gitee.com/funnyzak/cli-cheatsheets/raw/main/cheatsheet.sh | CLI_CHEATSHEET_REGION=cn bash -s -- "$@" }'使用如下命令查看速查表:
# 显示GIT速查表
cs git
# 显示所有支持的命令速查表
cs -l
# 帮助
cs -h让别名支持交互式菜单
如果你希望别名支持交互式菜单,可以使用以下命令:alias cs='() {
local tmpfile=$(mktemp)
curl -sSL "https://raw.githubusercontent.com/funnyzak/cli-cheatsheets/refs/heads/main/cheatsheet.sh" -o "$tmpfile" && chmod +x "$tmpfile" && "$tmpfile" "$@" && rm -f "$tmpfile"
}'配置完成后,然后执行 source ~/.bashrc 或 source ~/.zshrc 使配置生效。
如果不方便访问 raw.githubusercontent.com,可以使用以下命令,使用 Gitee 的镜像地址:
alias cs='() {
local tmpfile=$(mktemp)
curl -sSL "https://gitee.com/funnyzak/cli-cheatsheets/raw/main/cheatsheet.sh" -o "$tmpfile" && chmod +x "$tmpfile" && CLI_CHEATSHEET_REGION=cn "$tmpfile" "$@" && rm -f "$tmpfile"
}'将以下代码添加到你的 ~/.config/fish/config.fish 文件中:
function cs
curl -sSL https://raw.githubusercontent.com/funnyzak/cli-cheatsheets/refs/heads/main/cheatsheet.sh | bash -s -- $argv
end然后执行 source ~/.config/fish/config.fish 使配置生效。
配置别名后,你就可以使用 cs 命令快速访问速查表了:
cs git
cs docker
cs # 交互式菜单无需下载项目,直接通过 curl 命令远程执行脚本:
- 交互式菜单:
curl -s https://raw.githubusercontent.com/funnyzak/cli-cheatsheets/refs/heads/main/cheatsheet.sh -o cheatsheet.sh && chmod +x cheatsheet.sh && ./cheatsheet.sh- 查看指定命令的速查表:
curl -s https://raw.githubusercontent.com/funnyzak/cli-cheatsheets/refs/heads/main/cheatsheet.sh | bash -s -- git- 列出所有支持的命令:
curl -s https://raw.githubusercontent.com/funnyzak/cli-cheatsheets/refs/heads/main/cheatsheet.sh | bash -s -- -l-
下载项目:
git clone https://github.com/funnyzak/cli-cheatsheets.git cd cli-cheatsheets # 后续更新可以使用 git pull origin main
或着直接从
Release页面下载最新的压缩包,解压后进入目录。 -
赋予执行权限:
chmod +x cheatsheet.sh
-
运行脚本:
# 交互式菜单 (无参数) ./cheatsheet.sh # 查看指定命令的速查表 ./cheatsheet.sh git ./cheatsheet.sh docker ./cheatsheet.sh mongo # 列出所有支持的命令 ./cheatsheet.sh -l ./cheatsheet.sh --list # 显示帮助信息 ./cheatsheet.sh -h ./cheatsheet.sh --help # 使用自定义 URL 前缀 (高级用法) # 如果你将 cheatsheets 目录部署在自定义的 Web 服务器上 ./cheatsheet.sh -u https://example.com/path/ git
注意: 如果你在本地使用,确保确保
cheatsheet.sh文件具有执行权限。并且脚本同级目录下的cheatsheets/目录包含了所有速查表文件。或者你也可以在环境变量设置CLI_CHEATSHEET_PATH指向你本地的速查表文件目录。 例如:export CLI_CHEATSHEET_PATH="/Users/yourname/cli-cheatsheets/cheatsheets/"
CLI 速查表按类别组织在以下目录中:
├── LICENSE
├── cheatsheet.sh # 主脚本文件
├── cheatsheets # 速查表目录
│ ├── android
│ ├── build
│ ├── cli
│ ├── cloud
│ ├── container
│ ├── data-process
│ ├── database
│ ├── media
│ ├── network
│ ├── notification
│ ├── os
│ ├── package
│ ├── runtime
│ ├── security
│ ├── tools
│ ├── version-control
│ └── webserver
└── get-cheatsheet.sh # 远程获取速查表的脚本
- Android: Android 开发相关命令
- Build Tools: 构建工具
- CLI Tools: 命令行工具
- Cloud Tools: 云平台工具
- Container Tools: 容器化工具
- Data Process Tools: 数据处理工具
- Database: 数据库工具
- Media: 媒体处理工具
- Network: 网络工具
- Notification: 通知服务工具
- OS Commands: 操作系统命令
- Package Managers: 包管理器
- Runtime: 运行时环境
- Security: 安全工具
- Tools: 其他实用工具
- Version Control: 版本控制工具
- Web Servers: Web 服务器
(cheatsheets/android/) Android 开发相关命令 (1个工具)
adb-cheatsheet.txt: Android Debug Bridge (ADB) 命令
(cheatsheets/build/) 构建工具 (9个工具)
cmake-cheatsheet.txt: CMake 构建系统命令gradle-cheatsheet.txt: Gradle 构建工具命令mvn-cheatsheet.txt: Maven 构建工具命令bun-cheatsheet.txt: Bun JavaScript 运行时和包管理器命令flutter-cheatsheet.txt: Flutter 移动应用开发框架命令webpack-cheatsheet.txt: Webpack 模块打包工具命令react-native-cheatsheet.txt: React Native 移动应用开发框架命令vite-cheatsheet.txt: Vite 现代化前端构建工具命令xcodebuild-cheatsheet.txt: Xcode 命令行构建工具命令
(cheatsheets/cli/) 命令行工具 (4个工具)
ansible-cheatsheet.txt: Ansible 自动化工具命令claude-code-cheatsheet.txt: Claude Code AI 代码助手 CLI 工具命令helm-cheatsheet.txt: Helm Kubernetes 包管理器命令watchman-cheatsheet.txt: Watchman 文件监控工具命令
(cheatsheets/cloud/) 云平台工具 (6个工具)
awscli-cheatsheet.txt: AWS 命令行界面 (AWS CLI) 命令az-cheatsheet.txt: Azure 命令行界面 (Azure CLI) 命令rclone-cheatsheet.txt: Rclone 云存储同步工具命令rsync-cheatsheet.txt: Rsync 远程文件同步工具命令ossutil-cheatsheet.txt: 阿里云OSS命令行工具terraform-cheatsheet.txt: Terraform 基础设施即代码工具命令
(cheatsheets/container/) 容器化工具 (5个工具)
docker-cheatsheet.txt: Docker 容器平台命令kubectl-cheatsheet.txt: kubectl Kubernetes 命令行工具命令podman-cheatsheet.txt: Podman 容器管理工具命令docker-compose-cheatsheet.txt: Docker Compose 多容器编排工具命令kubectx-kubens-cheatsheet.txt: kubectx/kubens Kubernetes 上下文和命名空间切换工具命令
(cheatsheets/data-process/) 数据处理工具 (5个工具)
jq-cheatsheet.txt: jq JSON 处理器命令yq-cheatsheet.txt: yq YAML 处理器命令awk-cheatsheet.txt: awk 文本处理和模式扫描命令cut-cheatsheet.txt: cut 文本列提取命令sed-cheatsheet.txt: sed 流文本编辑器命令
(cheatsheets/database/) 数据库工具 (4个工具)
mongo-cheatsheet.txt: mongo MongoDB 客户端命令mysql-cheatsheet.txt: mysql MySQL 客户端命令psql-cheatsheet.txt: psql PostgreSQL 客户端命令redis-cli-cheatsheet.txt: redis-cli Redis 客户端命令
(cheatsheets/media/) 媒体处理工具 (3个工具)
ffmpeg-cheatsheet.txt: FFmpeg 音视频处理命令imagemagick-cheatsheet.txt: imageMagick 图像处理命令yt-dlp-cheatsheet.txt: yt-dlp 下载视频/音频命令
(cheatsheets/network/) 网络工具 (16个工具)
curl-cheatsheet.txt: curl 网络请求工具命令dig-cheatsheet.txt: dig DNS 查询工具命令frp-cheatsheet.txt: frp 内网穿透工具命令ifconfig-cheatsheet.txt: ifconfig 网络接口配置命令nc-cheatsheet.txt: nc (netcat) 网络工具命令netstat-cheatsheet.txt: netstat 网络连接状态查看命令nmcli-cheatsheet.txt: nmcli NetworkManager 命令行工具命令nslookup-cheatsheet.txt: nslookup DNS 查询命令ping-cheatsheet.txt: ping 网络连通性测试命令route-cheatsheet.txt: route 路由表管理命令scp-cheatsheet.txt: scp 安全文件拷贝命令ssh-cheatsheet.txt: ssh 安全 Shell 连接命令tcpdump-cheatsheet.txt: tcpdump 网络数据包分析命令telnet-cheatsheet.txt: telnet 远程登录命令traceroute-cheatsheet.txt: traceroute 路由追踪命令wget-cheatsheet.txt: wget 文件下载工具命令
(cheatsheets/notification/) 通知服务工具 (1个工具)
apprise-cheatsheet.txt: Apprise 通知服务工具命令
(cheatsheets/os/) 操作系统命令 (61个工具)
tmux-cheatsheet.txt: tmux 终端复用器命令apt-cheatsheet.txt: apt Debian/Ubuntu 包管理器命令awk-cheatsheet.txt: awk 文本处理命令cat-cheatsheet.txt: cat 查看文件内容命令chmod-cheatsheet.txt: chmod 修改文件权限命令chown-cheatsheet.txt: chown 修改文件所有者命令cut-cheatsheet.txt: cut 文本列提取命令date-cheatsheet.txt: date 显示或设置系统日期命令df-cheatsheet.txt: df 磁盘空间使用情况命令diff-cheatsheet.txt: diff 文件比较命令du-cheatsheet.txt: du 磁盘使用量统计命令free-cheatsheet.txt: free 内存使用情况命令grep-cheatsheet.txt: grep 文本搜索命令gzip-cheatsheet.txt: gzip 文件压缩命令history-cheatsheet.txt: history 命令历史记录命令htop-cheatsheet.txt: htop 交互式进程查看器命令ip-cheatsheet.txt: ip IP 地址和网络配置命令iptables-cheatsheet.txt: iptables Linux 防火墙命令kill-cheatsheet.txt: kill 终止进程命令killall-cheatsheet.txt: killall 按名称终止进程命令less-cheatsheet.txt: less 分页文件查看器命令ln-cheatsheet.txt: ln 创建链接命令lsof-cheatsheet.txt: lsof 列出打开文件命令more-cheatsheet.txt: more 分页文件查看器命令mount-cheatsheet.txt: mount 挂载文件系统命令nano-cheatsheet.txt: nano 文本编辑器命令operators-cheatsheet.txt: operators Shell 操作符参考pmap-cheatsheet.txt: pmap 进程内存映射命令ps-cheatsheet.txt: ps 进程状态查看命令sed-cheatsheet.txt: sed 流文本编辑器命令shutdown-cheatsheet.txt: shutdown 系统关机命令sort-cheatsheet.txt: sort 文本排序命令systemctl-cheatsheet.txt: systemctl Systemd 服务管理命令tail-cheatsheet.txt: tail 显示文件尾部命令tar-cheatsheet.txt: tar 归档工具命令top-cheatsheet.txt: top 动态进程查看器命令tree-cheatsheet.txt: tree 以树形结构显示目录命令uname-cheatsheet.txt: uname 显示系统信息命令unzip-cheatsheet.txt: unzip 解压缩工具命令uptime-cheatsheet.txt: uptime 系统运行时间命令vim-cheatsheet.txt: vim 文本编辑器命令watch-cheatsheet.txt: watch 定期执行命令命令yum-cheatsheet.txt: yum CentOS/RHEL 包管理器命令zip-cheatsheet.txt: zip 压缩工具命令cd_cheatsheet.txt: cd 切换当前工作目录命令clear_cheatsheet.txt: clear 清空终端屏幕命令cp_cheatsheet.txt: cp 复制文件和目录命令echo_cheatsheet.txt: echo 在终端输出文本命令find_cheatsheet.txt: find 在文件系统中搜索文件命令head_cheatsheet.txt: head 显示文件开头的内容命令ls_cheatsheet.txt: ls 列出目录内容命令man_cheatsheet.txt: man 显示命令的手册页命令mkdir_cheatsheet.txt: mkdir 创建新目录命令mv_cheatsheet.txt: mv 移动或重命名文件和目录命令pwd_cheatsheet.txt: pwd 显示当前工作目录的完整路径命令rm_cheatsheet.txt: rm 删除文件或目录命令service_cheatsheet.txt: service 控制系统服务的启动、停止和状态命令sudo_cheatsheet.txt: sudo 以超级用户或其他用户身份执行命令uniq_cheatsheet.txt: uniq 报告或忽略文件中的重复行命令wc_cheatsheet.txt: wc 统计文件中的行数、单词数和字符数命令xargs_cheatsheet.txt: xargs 从标准输入构建和执行命令行命令
(cheatsheets/package/) 包管理器 (13个工具)
apk-cheatsheet.txt: apk Alpine Linux 包管理器命令brew-cheatsheet.txt: brew macOS 包管理器命令cargo-cheatsheet.txt: cargo Rust 包管理器命令composer-cheatsheet.txt: composer PHP 依赖管理器命令gem-cheatsheet.txt: gem RubyGems 包管理器命令npm-cheatsheet.txt: npm Node.js 包管理器命令pacman-cheatsheet.txt: pacman Arch Linux 包管理器命令pip-cheatsheet.txt: pip Python 包管理器命令pipx-cheatsheet.txt: pipx Python 独立程序包管理器命令pnpm-cheatsheet.txt: pnpm 高性能 Node.js 包管理器命令poetry-cheatsheet.txt: poetry Python 依赖和包管理命令uv-cheatsheet.txt: uv 快速 Python 包安装器命令yarn-cheatsheet.txt: yarn Node.js 包管理器命令
(cheatsheets/runtime/) 运行时环境 (7个工具)
golang-cheatsheet.txt: golang Go 语言运行时命令java-cheatsheet.txt: java Java 运行时命令node-cheatsheet.txt: node Node.js 运行时命令php-cheatsheet.txt: php PHP 运行时命令python-cheatsheet.txt: python Python 运行时命令dotnet-cheatsheet.txt: .NET 运行时命令venv-cheatsheet.txt: Python 虚拟环境管理命令
(cheatsheets/security/) 安全工具 (5个工具)
nmap-cheatsheet.txt: nmap 网络扫描工具命令certbot-cheatsheet.txt: certbot Let's Encrypt 证书管理工具命令acme.sh-cheatsheet.txt: acme.sh Let's Encrypt 证书管理工具命令openssl-cheatsheet.txt: OpenSSL 加密工具箱命令ssh-keygen-cheatsheet.txt: SSH 密钥管理工具命令
(cheatsheets/tools/) 其他实用工具 (11个工具)
bat-cheatsheet.txt: bat 增强的 cat 命令工具exa-cheatsheet.txt: exa 现代化的 ls 命令工具tldr-cheatsheet.txt: tldr 简化的 man 页面工具fzf-cheatsheet.txt: fzf 命令行模糊查找器命令ripgrep-cheatsheet.txt: ripgrep (rg) 超快速文本搜索工具命令fd-cheatsheet.txt: fd 现代文件查找工具命令f2-cheatsheet.txt: f2 批量重命名工具命令zoxide-cheatsheet.txt: zoxide 智能目录跳转工具命令starship-cheatsheet.txt: starship 跨平台 shell 提示符命令gdb-cheatsheet.txt: gdb GNU 调试器命令make-cheatsheet.txt: make 构建工具命令
(cheatsheets/version-control/) 版本控制工具 (3个工具)
git-cheatsheet.txt: git 版本控制系统命令gh-cheatsheet.txt: gh GitHub CLI 工具命令gitlogue-cheatsheet.txt: gitlogue Git 历史动画回放工具命令
(cheatsheets/webserver/) Web 服务器 (3个工具)
apachectl-cheatsheet.txt: apachectl Apache 服务器控制命令caddy-cheatsheet.txt: caddy Caddy Web 服务器命令nginx-cheatsheet.txt: nginx NGINX Web 服务器命令
以上列的可能不是最新的,具体请查看
cheatsheets/目录下的文件。 速查表文件名格式为[命令]-cheatsheet.txt,其中-cheatsheet是固定后缀。
欢迎大家为本项目贡献速查表、改进脚本或提出建议!
贡献速查表:
- 在
cheatsheets/目录下找到或创建相应的类别子目录。 - 创建
[命令]-cheatsheet.txt文件,并按照清晰易读的格式编写速查表内容。 - 提交 Pull Request (PR) 到
main分支。
其他贡献:
- 如果你发现了脚本的 Bug 或有改进建议,欢迎提交 Issue 或 PR。
- 如果你想添加新的功能或类别,也欢迎提出讨论。
请确保你贡献的速查表内容准确、清晰、易于理解。
本项目采用 MIT License。
