网安
  • Develop
    • JAVA学习
      • 字节码
      • API开发
      • Web开发
      • 工程结构推荐
      • 创建第一个项目
      • 权限管控
      • 配置文件
      • 日志管理
      • 数据访问
      • 性能监控
      • IoC容器
      • Spring
      • Filter与Listener
      • jsp
      • MVC
      • servlet-1
      • servlet-2
      • servlet-3
      • servlet-4
      • FreeMarker
      • Thymeleaf
      • EL
      • SpEL
      • JSTL
      • 部署
      • JDBC
      • 数据库连接池
      • fastjson
      • jackson
      • XML
      • JSON
      • 序列化
      • Maven
      • 安装与使用
      • 工具
      • 爬虫
    • GO学习
      • GO
        • flag 包
        • goland 远程调试
        • GoReleaser
        • OS 包
        • time 包
        • 格式化输出
    • Lua学习
      • Lua
      • 基础语法
      • LuaJIT
      • 与系统交互
    • Pyhon
      • 基础
      • Django
      • CLI
      • miniforge
      • MockingBird
      • pdb
      • pyc
      • 装的我脑血栓要犯了
      • Python101
      • 反序列化
      • 爬虫
      • Pillow
      • 图像识别
      • flask
    • Speed-Ruby
      • 入门1
      • 入门2 对象
      • 入门3 创建命令
      • Encoding类
      • File类与Dir类
      • IO
      • Proc类
      • Time类与Date类
      • 正则
      • 错误处理与异常
      • 对象、变量和常量
      • 方法
      • 数值
      • 数组
      • 条件判断
      • 循环
      • 运算符
      • Socket编程
      • 字符串
      • 并发与线程
      • 块
      • 类和模块
      • 散列
    • Web
      • HTTP
        • Connection
        • HTTP 报文
        • Vary
      • 笔记
        • 跳转
        • 认证 & 授权
        • 同源策略(SOP)
        • 文件
    • Git 学习笔记
    • JSON
      • JSON 学习笔记
    • HTML
      • Speed-HTML
      • 语法学习
      • HTML字符实体
    • XML
      • XML 学习笔记
    • 计算机基础
      • 操作系统
      • 计算机组成
      • 算法
      • 内存
      • 字符编码
    • gnuplot 学习笔记
    • regex
  • Integrated
    • Linux
      • God-Linux
      • Secure-Linux
      • Power-Linux
      • IO模型
      • Speed-Linux
      • 发行版
      • 工具
      • 启动过程
      • 进程
      • 认证
      • 日志
      • 守护进程
      • 文件
      • 信息
      • VSFTP 配置案例
      • auditd
      • containerd
      • DNS 配置案例
      • Docker
      • Docker-Compose
      • firewalld 实验
      • gpg
      • Iptables
      • httpd
      • LAMP
      • mysql
      • nfs 配置案例
      • openssl
      • PAM
      • samba 配置案例
      • terraform
      • ufw
      • VSFTP 配置案例
    • Network
      • Speed-Net
      • Power-Net
      • SDN 笔记
      • DNS
      • TLS
    • Windows
      • Secure-Win
      • Speed-Win
      • ACL
      • LDAP
      • IPC$(Internet Process Connection)
      • PDB符号文件
      • 工作组
      • WinRM
      • 角色权限
      • 凭据
      • 签名
      • 日志
      • 认证
      • 协议
      • 信息
      • 应用
      • 组策略
      • 域
      • asp站点搭建
      • Exchange 搭建
      • Windows 故障转移集群
      • Windows 基础服务搭建
      • Windows 域搭建
      • 本地抓包
      • PowerShell 笔记
    • 容器
      • Docker
    • 数据库
      • Speed-SQL
      • Power-SQL
      • MSSQL
      • MySQL
      • Postgresql
      • Redis
      • MySQL大小写问题
      • 主键和外键
      • MySQL快速入门
      • 虚拟化
        • ESXi
        • vCenter
  • Plan
    • Mac-Plan
    • Misc-Plan
    • Team-Plan
    • Thinking-Plan
    • VM-Plan
  • Sercurity
    • Power-PenTest
    • BlueTeam
      • 安全建设
      • 分析
      • 加固
      • 取证
      • 应急
      • USB取证
      • 磁盘取证
      • 内存取证
      • ClamAV 部署
      • yara 实验
      • 安防设施搭建使用
      • ZIP明文攻击
      • 流量分析
    • Crypto
      • Crypto
        • 2020 9 G60攻防大赛
        • CTF
        • 2020 9 中能融合杯工控CTF
        • 2020 10 全国工业互联网安全技术技能大赛江苏省选拔赛
        • 2020 10 全国网络与信息安全管理职业技能大赛江苏场
        • 2020 11 I²S峰会暨工业互联网安全大赛
        • 2021 6 第二届I²S峰会暨工业互联网安全大赛
        • 2021-9-第七届工控信息安全攻防竞赛
        • 2021 9 第七届全国职工职业技能大赛某市县选拔赛
        • 2021 9 全国网络与信息安全管理职业技能大赛江苏场
        • 2021-10-G60攻防大赛
    • CTF
      • CTF
      • writeup
        • 2020 9 中能融合杯工控CTF
        • 2020 9 G60攻防大赛
        • 2020 10 全国工业互联网安全技术技能大赛江苏省选拔赛
        • 2020 10 全国网络与信息安全管理职业技能大赛江苏场
        • 2020 11 I²S峰会暨工业互联网安全大赛
        • 2021 6 第二届I²S峰会暨工业互联网安全大赛
        • 2021-9-第七届工控信息安全攻防竞赛
        • 2021 9 第七届全国职工职业技能大赛某市县选拔赛
        • 2021 9 全国网络与信息安全管理职业技能大赛江苏场
        • 2021-10-G60攻防大赛
    • ICS
      • PLC攻击
      • S7comm 相关
      • 工控协议
      • 上位机安全
      • Modbus 仿真环境搭建
      • siemens 仿真搭建实验
      • S7-300 启停实验
    • IOT
      • 无线电安全
        • RFID复制卡
        • RFID基础知识
        • WiFikiller
      • 硬件安全
        • DIY键盘嵌入指纹识别模块实验记录
        • Device-Exploits
        • HID-Digispark
        • HID-KeyboardLogger
        • HID-USBHarpoon
        • HID-USBKeyLogger
      • 固件安全
        • 固件安全
        • Dlink_DWR-932B 路由器固件分析
    • Mobile sec
      • 小程序安全
      • Android安全
    • PWN
      • SLMail溢出案例
      • PWN
    • Red Team
      • OS安全
        • Linux 安全
        • Exploits
        • NTLM中继
        • Windows 安全
        • Responder欺骗
        • Windows-LOL
      • Web_Generic
        • Top 10
          • RCE
          • Fileread
          • SQLi
          • SSRF
          • SSTI
          • Web Generic
          • XSS
          • XXE
      • Web_Tricks
        • JWT 安全
        • HTTP_request_smuggling
        • OOB
        • 绕过访问
      • 靶场
        • Hello-Java-Sec 学习
        • DVWA-WalkThrough
        • pikachu-WalkThrough
        • upload-labs-WalkThrough
        • XVWA-WalkThrough
        • XSS挑战-WalkThrough
      • 实验
        • flask
        • fastjson
        • Log4j
        • nodejs
        • Shiro
        • Spring
        • Weblogic
      • 前端攻防
      • IDOR
    • 安防设备
      • Exploits
      • Bypass 技巧
    • 后渗透
      • 权限提升
      • 后渗透
      • 权限维持
      • 实验
        • C2 实验
        • Exchange
        • 端口转发实验
        • 代理实验
        • 免杀实验
        • 隧道实验
    • 软件服务安全
      • Exploits
      • CS Exploits
      • 实验
        • Docker
        • Kubernetes
        • Mysql
        • Oracle
        • PostgreSQL
        • Redis
        • vCenter
    • 协议安全
      • Exploits
    • 信息收集
      • 端口安全
      • 空间测绘
      • 信息收集
    • 语言安全
      • 语言安全
        • 语言安全
      • GO安全
        • GO安全
        • Go代码审计
      • JAVA安全
        • JAVA安全
        • JAVA代码审计
        • JAVA反序列化
        • SpEL 注入
      • PHP安全
        • PHP安全
        • bypass_disable_function
        • bypass_open_basedir
        • phpinfo
        • PHP代码审计
        • PHP反序列化
        • PHP回调函数
        • 变量覆盖
        • POP
        • 弱类型
        • 伪协议
        • 无字母数字Webshell
      • Python安全
        • pyc反编译
        • Python安全
        • Python 代码审计
        • 沙箱逃逸
      • dotnet安全
      • JS安全
    • 云安全
      • 公有云安全
    • Reverse
      • Reverse
      • FILE
        • ELF
        • BMP
        • JPG
        • PE
        • PNG
        • ZIP
        • 文件头
      • 实验
        • PYAble
          • 2-逆运算
          • 1-基本分析
          • 3-异或
          • 4-Base64
          • 5-Base64换表
          • 6-动态调试
        • Windows
          • condrv.sys 内存损坏漏洞
    • 工具
      • Aircrack
      • BloodHound
      • Burp Suite
      • frp
      • CobaltStrike
      • Ghidra
      • fscan
      • Hashcat
      • IDA
      • merlin
      • Kali
      • Metasploit
      • Mimikatz
      • ModSecurity
      • Nmap
      • nps
      • nuclei
      • pupy
      • RedGuard
      • SET
      • sliver
      • Snort
      • Sqlmap
      • Suricata
      • Sysmon
      • uncover
      • Volatility
      • Wfuzz
      • Wireshark
      • xray
    • 安全资源
      • 靶机
        • VulnHub
          • DC
            • DC2 WalkThrough
            • DC1 WalkThrough
            • DC3 WalkThrough
            • DC4 WalkThrough
            • DC5 WalkThrough
            • DC6 WalkThrough
            • DC9 WalkThrough
            • DC8 WalkThrough
          • It's_October
            • It’s_October1 WalkThrough
          • Kioptrix
            • Kioptrix2 WalkThrough
            • Kioptrix3 WalkThrough
            • Kioptrix4 WalkThrough
            • Kioptrix5 WalkThrough
          • Mission-Pumpkin
            • PumpkinGarden-WalkThrough
            • PumpkinFestival WalkThrough
            • PumpkinRaising WalkThrough
          • Symfonos
            • symfonos1 WalkThrough
            • symfonos2 WalkThrough
            • symfonos3 WalkThrough
            • symfonos5 WalkThrough
        • Wargames
          • Bandit
            • Bandit-WalkThrough
      • 面试问题
        • 面试问题
Powered by GitBook
On this page
  • 有趣的工具
  • 各种shell
  • 系统信息
  • 网络测试调试
  • 模拟器
  • 格式处理
  • XML
  • JSON
  • html
  • 图像视频
  • 提高生产力
  • 定时任务
  • 辅助
  1. Integrated
  2. Linux

工具

这里记录一些平时收集的一些工具或有趣的东西


有趣的工具

2048-cli

终端中的 2048

dnf install 2048-cli

MapSCII

在终端显示世界地图

  • https://www.ostechnix.com/mapscii-world-map-terminal/

telnet mapscii.me

neofetch

命令行系统信息工具

  • https://github.com/dylanaraps/neofetch

apt-get update
apt-get install -y neofetch

neofetch

star war

一段 22 分钟长的 ASCII 动画

  • http://www.asciimation.co.nz/

telnet towel.blinkenlights.nl

nyancat

终端中的 Nyancat

  • https://github.com/klange/nyancat

git clone https://github.com/klange/nyancat.git
cd nyancat
make && cd src
./nyancat

yes

yes命令在命令行中输出指定的字符串,直到yes进程被杀死。不带任何参数输入yes命令默认的字符串就是y。

yes hahaa
yes yes | xxx.sh

lolcat

彩色输出

  • https://github.com/busyloop/lolcat

gem install lolcat
echo "test" | lolcat

各种shell

fish

一个挺好用的 shell 环境

  • https://github.com/fish-shell/fish-shell

apt-add-repository ppa:fish-shell/release-3
apt-get update
apt-get install -y fish
  • 更多文章

oh-my-zsh

  • https://github.com/robbyrussell/oh-my-zsh

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

themes

  • https://github.com/robbyrussell/oh-my-zsh/wiki/themes

    下载完放置在 ~/.oh-my-zsh/themes 目录目录下,并在配置文件 .zshrc 中进行指定.

    vim ~/.zshrc
    
    ZSH_THEME="<指定你的主题>"

powerline-shell

增强美化 shell 的工具

  • https://github.com/b-ryan/powerline-shell

依赖 python 环境

pip install powerline-shell

  • fish

    vim ~/.config/fish/config.fish
    
    function fish_prompt
        powerline-shell --shell bare $status
    end

starship

轻量级、反应迅速,可定制的高颜值终端!

curl -fsSL https://starship.rs/install.sh | bash

将初始化脚本添加到您的 shell 的配置文件

# Bash
echo "eval \"\$(starship init bash)\"" >> ~/.bashhrc

# Fish
echo "starship init fish | source" >> ~/.config/fish/config.fish

# Zsh
echo "eval \"\$(starship init zsh)\"" >> ~/.zshrc

mosh

使用 UDP 传输的 Shell

apt install mosh

mosh --ssh="ssh -p 2222" root@host

系统信息

duf

显示磁盘使用状态

  • https://github.com/muesli/duf

wget https://github.com/muesli/duf/releases/download/v0.7.0/duf_0.7.0_linux_amd64.deb
dpkg -i duf_0.7.0_linux_amd64.deb
duf

glances

top/htop 的替代品

  • https://github.com/nicolargo/glances

curl -L https://bit.ly/glances | /bin/bash

glances

inxi

显示系统和硬件信息

apt-get install inxi

inxi -F
# -A          显示音频 声卡相关信息
# -b          输出基本信息
# -c [0-32]   不同的配色
# -C          显示完整的 CPU 信息
# -d          显示光驱和硬盘相关信息
# -D          显示硬盘相关信息
# -F          完整报告
# -G          显卡
# -i          WAN IP
# -I          processes, uptime, memory, shell type etc
# -m          RAM data
# -M          machine data 主板,BIOS etc
# -p          完整分区信息
# -S          系统信息,hostname,kernel,桌面环境,发行版等等
# -u          分区 UUID

btop

  • https://github.com/aristocratos/btop

wget https://github.com/aristocratos/btop/releases/download/v1.2.0/btop-x86_64-linux-musl.tbz
tar -xjvf btop-x86_64-linux-musl.tbz
bash install.sh

btop

网络测试调试

BestTrace

路由跟踪程序

cd /home && mkdir tmp && cd tmp
wget https://cdn.ipip.net/17mon/besttrace4linux.zip
unzip besttrace4linux.zip
chmod +x besttrace
mv besttrace /usr/local/bin
cd /home && rm -rf /home/tmp
# 安装完成后,就可以用指令 besttrace IP/域名 来追踪路由了

Fast

Fast 是 Netflix 提供的服务。它的网址是 Fast.com,同时它有一个可通过 npm 安装的命令行工具:

npm install --global fast-cli
```bash
```bash
fast    # 该命令返回你的网络下载速度
fast -u # 获取上传速度

httpie

命令行下的 HTTP 客户端

  • https://github.com/jakubroztocil/httpie

yum install -y httpie

或

apt-get install -y httpie
http httpie.org

iPerf

iPerf 是测试网速的工具

# debian
apt install -y iperf

# centos
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
rpm -Uvh rpmforge-release-1.5.3-1.el7.rf.x86_64.rpm
yum update
yum install -y iperf

安装完成后,你需要在同一网络上的两台计算机上使用它(两台都必须安装 iPerf)。指定其中一台作为服务器。

在服务端启动 iperf

iperf -s

它会等待来自客户端的传入连接。将另一台计算机作为为客户端并运行此命令

iperf -c <服务端IP>

只需几秒钟即可完成测试,然后返回传输大小和计算出的带宽。

speedtest-cli

Speedtest.net 提供一个命令行版本——speedtest-cli,能够在终端中简单快速的测试出 linux 的网速

  • https://github.com/sivel/speedtest-cli

wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod a+rx speedtest.py
mv speedtest.py /usr/local/bin/speedtest-cli
chown root:root /usr/local/bin/speedtest-cli
speedtest-cli

或

pip install speedtest-cli
speedtest-cli

gping

图形化的 ping 工具

echo "deb http://packages.azlux.fr/debian/ buster main" | sudo tee /etc/apt/sources.list.d/azlux.list
wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add -
sudo apt update
sudo apt install gping

nethogs

查看每个进程流量

apt install nethogs
nethogs

ab

ab 是 apache 的压力测试工具

安装

apt install -y apache2-utils

yum install -y httpd-tools

wrk

压测工具

  • https://github.com/wg/wrk

git clone --depth 1 https://github.com/wg/wrk.git
cd wrk && make
cp wrk /usr/local/bin/

wrk
wrk -t12 -c1000 -d15s http://127.0.0.1

websocat

nc 的 WebSocket 版

  • https://github.com/vi/websocat


模拟器

mono

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
apt-get update

apt-get install -y mono-devel mono-complete referenceassemblies-pcl ca-certificates-mono

格式处理

base64

base64  # 编码
test    # 输入内容
Ctrl+D  # 结束,输出

base64 -d   # 解码
dGVzdAo=
Ctrl+D  # 结束,输出
echo "str" | base64 -w 0
echo "c3RyCg==" | base64 -d

这个傻逼工具会默认每 76 个字符换行,格式化输出,用 -w 0 关闭

expand

将 TAB 转换为空格

expand test.txt

unexpand

将空格转换为 TAB

unexpand test.txt

sttr

cross-platform, cli app to perform various operations on string

  • https://github.com/abhimanyu003/sttr

sttr md5 "Hello World"
sttr base64-encode image.jpg

echo "Hello World" | sttr md5
cat file.txt | sttr md5

seq

seq 命令用于生成某个范围内的整数

seq [选项]... [首数] [增量] 尾数

seq 10                  # 输出1-10的所有整数

seq 3 5                 # 输出3-5的所有整数

seq 1 2 5               # 1-5,增量为2

seq -f "id:%06g" 1 2 5  # 以特定格式输出

seq -w 1 101            # 使所有数据等宽

seq -w -s ' ' 99 101    # 以空格分隔所有的数据

choose

cut 命令的替代品, 用来选中指定的栏位。

  • https://github.com/theryangeary/choose

cat test.txt | choose 0
choose 0 -i test.txt

csvtk

命令行下处理 CSV/TSV格式

  • https://github.com/shenwei356/csvtk

dsq

一个命令行工具,可以对 JSON、CSV、Excel 等格式的文件执行 SQL 查询语句。

  • https://github.com/multiprocessio/dsq

yq

像 jq 一样对 yaml,json,xml 使用 yq

  • https://github.com/mikefarah/yq

go install github.com/mikefarah/yq/v4@latest

tee test.yaml <<-'EOF'
volumes:
  beehive-conf:
    driver: local
services:
  - beehive
EOF

yq '.volumes.beehive-conf' test.yaml
yq '.services' test.yaml

XML

xmllint

解析 xml 格式

sudo apt-get install  libxml2-utils
xmllint --xpath "//book[@id=2]/name/text()" sample.xml

xpath

解析 xml 格式

xpath -e '//book/name/text()' sample.xml

JSON

jq

该工具帮助阅读 json 格式的数据

apt-get install -y jq

JsonData='[
    {"Book":"PHP 7"},
    {"Publication":"Apress"},
    {"Book":"React 16 Essentials"},
    {"Publication":"Packt"}
]'

echo "${JsonData}" | jq '.'
cat test.json | jq '.[].ip+":"'
cat test.json | jq '.[].port'
cat craw1.json | jq '.req_list[].url'
cat test.json | jq '.' -r   # 不带双引号
cat chaos-bugbounty-list.json | jq -r '.programs[] | select(.bounty == true) | .domains' | sort -u | cut -d '"' -f2 > urls.txt
  • 相关教程

    • https://justcode.ikeepstudying.com/2018/02/shell%EF%BC%9A%E6%97%A0%E6%AF%94%E5%BC%BA%E5%A4%A7%E7%9A%84shell%E4%B9%8Bjson%E8%A7%A3%E6%9E%90%E5%B7%A5%E5%85%B7jq-linux%E5%91%BD%E4%BB%A4%E8%A1%8C%E8%A7%A3%E6%9E%90json-jq%E8%A7%A3%E6%9E%90-json/

    • https://mozillazg.com/2018/01/jq-use-examples-cookbook.html

    • https://www.jianshu.com/p/6de3cfdbdb0e

  • 在线调试

    • https://jqplay.org/

jo

生成json格式数据的小工具

  • https://github.com/jpmens/jo

wget https://github.com/jpmens/jo/releases/download/1.6/jo-1.6.tar.gz
tar xvzf jo-1.6.tar.gz
cd jo-1.6
autoreconf -i
./configure
make check
make install

jo name=Jane
seq 1 10 | jo -a
jo time=$(date +%s) dir=$HOME
jo -p -a spring summer winter

jd

json 比较工具

  • https://github.com/josephburnett/jd

go install github.com/josephburnett/jd@latest

jd a.json b.json

gron

json 数据格式化

  • https://github.com/TomNomNom/gron

go install github.com/tomnomnom/gron@latest

gron test.json

jless

命令行的json查看工具

  • https://jless.io/

html

htmlq

像 jq 一样对 html 使用 yq

  • https://github.com/mgdm/htmlq


图像视频

imcat

在终端显示任何图片

  • https://github.com/stolk/imcat

git clone https://github.com/stolk/imcat.git
make
./imcat xxx.png

Termtosvg

将你在 Linux 终端中操作录制成 SVG 动画

pip3 install termtosvg pyte python-xlib svgwrite
termtosvg
# 按下 CTRL+D 或输入 exit 来停止录制。录制完后,输出文件会以一个独一无二的名字被保存在 /tmp 文件夹中。

gimp

GIMP(全称 Gnu 图像处理程序)是一款免费的、跨平台的开源图像处理程序。

add-apt-repository ppa:otto-kesselgulasch/gimp
apt-get update
apt-get install -y gimp     # 安装 gimp
gimp                        # 启动 gimp

asciinema

pip3 install asciinema

apt-get install asciinema
yum install asciinema
dnf install asciinema
asciinema rec

zbarimg

命令行解析二维码

apt install zbar-tools
zbarimg xxx.png

montage

将多个小图片拼成一张图

apt install imagemagick

montage xxx.jpg -tile 8x15 -geometry 200x100+0+0 output.jpg

gaps

修复、还原图片

gaps --image=output.jpg --generations=40 --population=120 --size=100

gaps -image=flag.jpg -generations=50 -population=120 -size=50

提高生产力

bc

任意精度计算器

bc  # 进入交互模式,输入 quit 退出

# e.g.
echo "15+5" | bc
echo "10^10" | bc
echo "sqrt(100)" | bc
echo 'scale=2; (2.777 - 1.4744)/1' | bc     # scale=2 设小数位,2 代表保留两位:

rlwrap

解决各类 shell 中无法上下左右的问题

apt install rlwrap
rlwrap [Command]

trash-cli

回收站的命令行界面

  • https://github.com/andreafrancia/trash-cli

pip3 install trash-cli

tr

命令行届的翻译

# 转换大小写
echo "abc" | tr a-z A-Z
echo "abc" | tr [:lower:] [:upper:]

# 将空白转换成 TABs
echo "a b" | tr [:space:] '\t'

# 转换括号
echo "{abc}" | tr "{}" "()"

# 删除 -d 指定的字符集
echo "abc" | tr -d 'a'

# 删除数字
echo "123abc123" | tr -d [:digit:]

# 删除连续空白
echo "emmmmmmmmmm   no" | tr -s [:space:] ' '

# 删除空行
cat test.txt | tr -s '\n'

# squeeze repeats
echo "abbbbccccbd"  | tr -s a-z A-Z

# 删除除了数字之外的内容
echo "my id is 123" | tr -cd [:digit:]

# 将不是 SET1 中的内容,替换为 SET2 中内容
echo 'abc123' | tr -c [:digit:] x

xclip

在 Linux 命令行中复制粘贴

xclip file_name     # 将文件的内容复制到剪贴板

hexyl

命令行十六进制查看器

apt install hexyl

hexyl a.png

DeepL

非常好用的翻译软件

yarn global add deepl-translator-cli

deepl translate -t 'DE' 'How do you do?'

translate-shell

wget git.io/trans
chmod +x ./trans

./trans 'Saluton, Mondo!'

anew

  • https://github.com/tomnomnom/anew

cat newthings.txt | anew things.txt
cat newthings.txt | anew things.txt > 1.txt

ranger

linux 文件管理工具 ranger, 具有 Vim 式的操作方式.

apt install ranger && pip install ranger-fm
ranger

# 使用 h,j,k,l 来进行光标的移动, 来穿越在不同的文件夹中
# q 退出
# S 来进行当前光标所在的文件夹中 exit 命令重新回到 ranger 程序当中去

使用 ranger --copy-config=all 将在 ~/.config/ranger 中生成一系列配置文件, 其中 ranger 主要有 4 个配置文件.

  • rc.conf 常用于设置选项和绑定快捷键.(最常用)

  • scope.sh 常用于设置文件的预览方式.

  • rifle.conf 常用于设置使用那个软件来打开文件.

  • commands.py python 文件, 增强和改进 ranger 的各种功能.

exa

ls 的替代品

  • https://github.com/ogham/exa

# fefora
dnf install exa

# debian
apt install exa
exa -l -F

broot

类似 ranger 的树形图目录查看工具

  • https://github.com/Canop/broot

br -s

bat

cat 的替代品

# fefora
dnf install bat

# debian
wget https://github.com/sharkdp/bat/releases/download/v0.19.0/bat_0.19.0_amd64.deb
dpkg -i bat_0.19.0_amd64.deb

定时任务

  • https://github.com/dshearer/jobber

  • https://github.com/rundeck/rundeck

  • https://github.com/shunfei/cronsun


辅助

wait-for

监测服务是否可用

  • https://github.com/eficode/wait-for

./wait-for www.eficode.com:80 -- echo "Eficode site is up"
Eficode site is up

wait-for-it

监测服务是否可用

  • https://github.com/vishnubob/wait-for-it

./wait-for-it.sh -t 0 db:3306 -- echo "mysql is up"
./wait-for-it.sh -t 0 rabbitmq:5672 -- echo "rabbitmq is up"

yes

帮你自动回答命令行提示

yes | rm -i *.test
yes n | rm -i *.test

usql

多合一命令行下数据库管理工具

  • https://github.com/xo/usql

GO111MODULE=on go install -tags 'all' github.com/xo/usql@latest
# 或
go install github.com/xo/usql@master
# connect to a postgres database
$ usql pg://user:pass@host/dbname
$ usql pgsql://user:pass@host/dbname
$ usql postgres://user:pass@host:port/dbname
$ usql pg://
$ usql /var/run/postgresql
$ usql pg://user:pass@host/dbname?sslmode=disable # Connect without SSL

# connect to a mysql database
$ usql my://user:pass@host/dbname
$ usql mysql://user:pass@host:port/dbname
$ usql my://
$ usql /var/run/mysqld/mysqld.sock

# connect to a sqlserver database
$ usql sqlserver://user:pass@host/instancename/dbname
$ usql ms://user:pass@host/dbname
$ usql ms://user:pass@host/instancename/dbname
$ usql mssql://user:pass@host:port/dbname
$ usql ms://

# connect to a sqlserver database using Windows domain authentication
$ runas /user:ACME\wiley /netonly "usql mssql://host/dbname/"

# connect to a oracle database
$ usql or://user:pass@host/sid
$ usql oracle://user:pass@host:port/sid
$ usql or://

# connect to a cassandra database
$ usql ca://user:pass@host/keyspace
$ usql cassandra://host/keyspace
$ usql cql://host/
$ usql ca://

# connect to a sqlite database that exists on disk
$ usql dbname.sqlite3

# NOTE: when connecting to a SQLite database, if the "<driver>://" or
# "<driver>:" scheme/alias is omitted, the file must already exist on disk.
#
# if the file does not yet exist, the URL must incorporate file:, sq:, sqlite3:,
# or any other recognized sqlite3 driver alias to force usql to create a new,
# empty database at the specified path:
$ usql sq://path/to/dbname.sqlite3
$ usql sqlite3://path/to/dbname.sqlite3
$ usql file:/path/to/dbname.sqlite3

# connect to a adodb ole resource (windows only)
$ usql adodb://Microsoft.Jet.OLEDB.4.0/myfile.mdb
$ usql "adodb://Microsoft.ACE.OLEDB.12.0/?Extended+Properties=\"Text;HDR=NO;FMT=Delimited\""

# connect with ODBC driver (requires building with odbc tag)
$ cat /etc/odbcinst.ini
[DB2]
Description=DB2 driver
Driver=/opt/db2/clidriver/lib/libdb2.so
FileUsage = 1
DontDLClose = 1

[PostgreSQL ANSI]
Description=PostgreSQL ODBC driver (ANSI version)
Driver=psqlodbca.so
Setup=libodbcpsqlS.so
Debug=0
CommLog=1
UsageCount=1
# connect to db2, postgres databases using ODBC
$ usql odbc+DB2://user:pass@localhost/dbname
$ usql odbc+PostgreSQL+ANSI://user:pass@localhost/dbname?TraceFile=/path/to/trace.log

croc

Easily and securely send things from one computer to another

  • https://github.com/schollz/croc

A : send file

croc send xxx.txt

Code is: xxxx-xxxx

B : receive file

croc xxxx-xxxx

magic-wormhole

get things from one computer to another, safely

  • https://github.com/magic-wormhole/magic-wormhole

fq

jq for binary formats

fq . file.mp3
Previous发行版Next启动过程

如何在 Linux 中安装、配置和使用 Fish Shell?