跳到主要内容

工具列表

以下為已實現並接入分發的全部命令(193 個)。md5/sha* 為 BSD 風格命名,md5sum/sha*sum 為 GNU 風格命名,兩者輸出相同。

文件與目錄

命令說明示例
ls列出目錄內容notools ls -l /tmp
dir類似 ls,預設不彩色、按列輸出notools dir
vdir等同 ls -lnotools vdir
tree顯示目錄樹notools tree -L 2
cat輸出文件內容notools cat file.txt
cp複製文件 / 目錄(支持多源、-r 遞迴)notools cp a.txt b.txt dir/
mv移動或重命名notools mv a.txt b.txt
rm刪除文件或目錄notools rm -r dir/
ln創建硬鏈接 / 符號鏈接(-s)notools ln -s src.txt link.txt
link創建硬鏈接notools link a b
unlink刪除單個文件notools unlink a.txt
touch創建空文件或更新時間戳notools touch new.txt
mkdir創建目錄notools mkdir -p a/b/c
rmdir刪除空目錄notools rmdir empty/
mkfifo創建命名管道notools mkfifo /tmp/pipe
mknod創建特殊文件notools mknod /tmp/f p
mktemp安全創建臨時文件 / 目錄notools mktemp -d
tempfile創建臨時文件notools tempfile
install複製文件並設置屬性notools install -m 755 a b
chmod修改文件權限notools chmod 755 script.sh
chown修改文件屬主notools chown user:group file
chgrp修改文件屬組notools chgrp staff file
find遞迴查找文件notools find . -name "*.no"
du估算文件 / 目錄磁碟佔用notools du dir/
df顯示文件系統磁碟空間notools df
stat顯示文件狀態信息notools stat file.txt
file判斷文件類型notools file data.bin
rename批量重命名文件notools rename 's/\.old/.new/' *.old
dd按塊複製 / 轉換文件notools dd if=in of=out bs=512
basename取路徑末尾文件名notools basename /a/b/c.txt
dirname取路徑目錄部分notools dirname /a/b/c.txt
pwd列印當前工作目錄notools pwd
readlink讀取符號鏈接目標notools readlink link
realpath輸出規範絕對路徑notools realpath ../a/b
namei逐段解析路徑notools namei /a/b/c
pathchk檢查路徑可移植性notools pathchk path
dircolors輸出 ls 配色設置notools dircolors
shred安全擦除文件內容notools shred secret.txt
truncate縮減 / 擴展文件到指定大小notools truncate -s 0 log
sync刷新文件系統緩衝notools sync

文本查看與處理

命令說明示例
echo輸出參數notools echo -n hello
printf格式化輸出notools printf '%d\n' 42
head輸出文件開頭 N 行(-n N)notools head -n 10 file.txt
tail輸出文件末尾 N 行(-n N)notools tail -n 5 file.txt
more分頁查看文件notools more file.txt
less增強版分頁器(前後翻頁、搜索)notools less file.txt
tac逆序輸出行notools tac file.txt
nl添加行號notools nl file.txt
pr分頁排版列印notools pr file.txt
fold折斷過長行notools fold -w 80 file
fmt段落重排notools fmt -w 72 file
expand製表符轉空格notools expand file
unexpand空格轉製表符notools unexpand -a file
column列對齊排版notools column -t data
cut按字段(-d/-f)或字符(-c)截取echo "a,b" | notools cut -d, -f 1
paste合併文件列notools paste a b
join按公共字段連接notools join a b
comm比較兩個有序文件notools comm a b
csplit按模式切分文件notools csplit file /pattern/
split按大小 / 行數切分文件notools split -l 100 file
tr字符轉換 / 刪除echo "abc" | notools tr a X
rev反轉每行字符echo "abc" | notools rev
grep搜索文本模式notools grep -n pattern file.txt
egrep等同 grep -E(擴展正則)notools egrep 'a|b' file
fgrep等同 grep -F(固定串)notools fgrep literal file
sed流編輯器(替換)notools sed 's/old/new/g' file.txt
awk字段提取notools awk '{print $1}' file.txt
sort排序行notools sort -r file.txt
uniq去除連續重複行notools uniq -c file.txt
shuf隨機打亂行notools shuf file.txt
tsort拓撲排序notools tsort deps
wc統計行/詞/字節notools wc -l file.txt
tee輸出到 stdout 並同時寫入文件echo hi | notools tee out.txt
strings提取可列印字串notools strings bin
od八進制 / 多進制轉儲notools od -Ax -tx1 file
hexdump十六進制轉儲notools hexdump -C file
xxd十六進制轉儲 / 還原notools xxd file
envsubst替換環境變量echo '$HOME' | notools envsubst
dos2unixCRLF → LFnotools dos2unix file
unix2dosLF → CRLFnotools unix2dos file
mac2unixCR → LFnotools mac2unix file
unix2macLF → CRnotools unix2mac file
cmp逐字節比較兩文件notools cmp a b
diff逐行差異比較notools diff a b
diff3三路差異比較notools diff3 a b c
sdiff並排差異比較notools sdiff a b
patch應用 diff 補丁notools patch < fix.diff
test條件求值notools test -f file
[test 的同義形式notools [ -f file ]

歸檔與壓縮

命令說明示例
tar創建/解壓/列出 tar 歸檔notools tar -cf out.tar file
zip創建 zip 歸檔notools zip out.zip file1 file2
unzip解壓/列出 zip 歸檔notools unzip -l out.zip
gzipgzip 壓縮notools gzip file
gunzipgzip 解壓notools gunzip file.gz
zcat解壓並輸出到 stdoutnotools zcat file.gz
bzip2bzip2 壓縮(純 Nolang,BWT + Huffman)notools bzip2 file
bunzip2bzip2 解壓notools bunzip2 file.bz2
bzcat解壓 .bz2 到 stdoutnotools bzcat file.bz2
xzXZ 壓縮(純 Nolang,LZMA2)notools xz file
unxzXZ 解壓notools unxz file.xz
xzcat解壓 .xz 到 stdoutnotools xzcat file.xz
lzmaLZMA 壓縮(傳統 .lzma 格式)notools lzma file
unlzmaLZMA 解壓notools unlzma file.lzma
lzcat解壓 .lzma 到 stdoutnotools lzcat file.lzma
zstdZstandard 壓縮(純 Nolang,FSE + Huffman)notools zstd file
unzstdZstandard 解壓notools unzstd file.zst
zstdcat解壓 .zst 到 stdoutnotools zstdcat file.zst
compressLZW .Z 壓縮(純 Nolang)notools compress file
uncompressLZW .Z 解壓(純 Nolang)notools uncompress file.Z

系統信息與管理

命令說明示例
ps列出進程notools ps -ef
top顯示系統資源與進程notools top -n 20
free顯示內存使用notools free
lscpu顯示 CPU 架構信息notools lscpu
uname列印系統信息notools uname -a
arch列印機器架構notools arch
uptime系統運行時間與負載notools uptime
hostname列印 / 設置主機名notools hostname
domainname列印 NIS 域名notools domainname
hostid列印主機標識notools hostid
dmesg列印內核日誌notools dmesg
date顯示系統日期與時間notools date
cal顯示日曆notools cal
nproc列印可用 CPU 數notools nproc
whoami列印當前用戶名notools whoami
id列印用戶 / 組 IDnotools id
groups列印用戶所屬組notools groups
logname列印登錄用戶名notools logname
who列出登錄會話(簡化版)notools who
users列出當前登錄用戶名notools users
pinky輕量級 who(用戶信息)notools pinky
tty列印終端名notools tty
getconf查詢系統配置值notools getconf PATH_MAX
locale列印區域設置notools locale
logger寫入系統日誌notools logger 'msg'
env顯示 / 設置環境變量運行命令notools env
printenv列印環境變量notools printenv PATH
watch週期執行命令notools watch -n 1 date
clear清屏notools clear
reset重置終端notools reset
sleep暫停指定時長(支持 s/m/h)notools sleep 1
which定位可執行文件路徑notools which ls
whereis定位二進制 / 源碼 / 手冊notools whereis ls
locate基於預建資料庫的快速文件查找notools locate pattern
updatedb更新 locate 資料庫notools updatedb -U /
ptx生成置換索引notools ptx file.txt

進程與作業控制

命令說明示例
chroot切換根目錄運行命令(需 root,原生 os.chroot()notools chroot /newroot /bin/sh
stdbuf調整命令的 stdio 緩衝模式(純 Nolang 管道代理)notools stdbuf -oL cat file
kill發送信號給進程notools kill -9 1234
killall按名稱殺進程notools killall myapp
pgrep按名稱查進程號notools pgrep myapp
pkill按名稱發信號notools pkill myapp
pidof查找運行中程序的 PIDnotools pidof myapp
nice以調整後的優先級運行命令notools nice -n 5 cmd
renice調整運行中進程優先級notools renice 5 -p 1234
nohup忽略 SIGHUP 運行命令notools nohup cmd &
timeout限時運行命令notools timeout 5 cmd
time統計命令耗時notools time cmd
setsid在新會話中運行命令notools setsid cmd
flock文件鎖notools flock /tmp/lock cmd

網絡

命令說明示例
curl純 Nolang HTTP/1.1 客戶端(net TCP 實現,支持 http://https://notools curl https://127.0.0.1:8443/file
ping純 Nolang ICMP 回顯請求(內置 net.ping,默認 -c 4,支持 IP 和域名)notools ping -c 4 example.com

哈希與編碼

命令說明示例
md5MD5 摘要(128 位,純 Nolang 實現)notools md5 file.txtecho -n abc | notools md5
md5sumMD5 摘要(GNU 風格)notools md5sum file.txt
sha1SHA-1 摘要(160 位)notools sha1 file.txt
sha1sumSHA-1 摘要(GNU 風格)notools sha1sum file.txt
sha224SHA-224 摘要(224 位)notools sha224 file.txt
sha224sumSHA-224 摘要(GNU 風格)notools sha224sum file.txt
sha256SHA-256 摘要(256 位)notools sha256 file.txt
sha256sumSHA-256 摘要(GNU 風格)notools sha256sum file.txt
sha384SHA-384 摘要(384 位,64 位字運算)notools sha384 file.txt
sha384sumSHA-384 摘要(GNU 風格)notools sha384sum file.txt
sha512SHA-512 摘要(512 位,64 位字運算)notools sha512 file.txt
sha512sumSHA-512 摘要(GNU 風格)notools sha512sum file.txt
cksumCRC 校驗和notools cksum file
sumBSD / SYSV 校驗和notools sum file
base32Base32 編碼 / 解碼(-dnotools base32 file
base64Base64 編碼/解碼(RFC 4648,-d 解碼)notools base64 file.binecho -n YWJj | notools base64 -d
hmacHMAC 密鑰摘要(-a md5|sha1|sha256|sha512-k 指定密鑰,預設 sha256)notools hmac -a sha256 -k key message
uuencodeUU 編碼notools uuencode file
uudecodeUU 解碼notools uudecode file.uu
uuidgen生成 UUIDnotools uuidgen
uuidparse解析 UUIDnotools uuidparse <uuid>
mcookie生成隨機 cookienotools mcookie
b2sumBLAKE2b 摘要(GNU coreutils,-c 校驗模式)notools b2sum file.txt

數學與雜項

命令說明示例
expr整數算術 / 字串求值notools expr 1 + 2
factor質因數分解notools factor 60
numfmt數字格式化(K/M/G 等)notools numfmt --to=iec 1024
seq輸出數字序列notools seq 1 2 10
true退出碼恆為 0notools true
false退出碼恆為 1notools false
yes重複輸出字串notools yes y
getopt解析命令行選項notools getopt -o ab: -- -a -b x
xargs從 stdin 構建並執行命令find . -name '*.txt' | notools xargs rm