命令行的艺术
命令行的艺术 bg, fg and CTRL+Z ssh-add, ssh-agent ls -i描述符, df -i个数 dig grep -i, -v, -o, -A, -B, -C xargs pgrep, pkill lsof here documents python -m http.server 7777 128限制 ag wc, tee awk, sed, grep httpie ncdu awk sw_vers BASH ${#varname} ${varname:offset:length} ${variable#pattern} ${variable##pattern} ${path##*/} ${variable/#pattern/string} ${file%.png}.jpg ${varname^^} ${varname,,} shell $0 脚本文件名 $1 对应脚本的第一个参数 $# 参数的总数 $@ 全部的参数 read 1 2 3 4 5 6 filename='/etc/hosts' while read myline do echo "$myline" done < $filename IFS 1 2 3 4 5 input="/path/to/txt/file" while IFS= read -r line do echo "$line" done < "$input" 上面的命令可以逐……