文件
- 初始化文件
echo 'init' > test.txt
- 追加字符串到文件
echo 'init' >> test.txt
- 替换字符串
sed -i s#\'#\"#g test.txt
文件夹
- 文件夹内所有文件的总行数
find ./target-directory -type f | xargs cat | wc -l
- 替换文件夹内所有文件中的字符串
find ./* -exec sed -i 's/apple/iphone/g' {} \;
在线工具
- 运行时 https://c.runoob.com/compile/18
- shell 解析 https://explainshell.com/
引用
- 文件夹内所有文件的总行数 https://blog.youkuaiyun.com/qq_32599479/article/details/91473149
- 替换文件夹内所有文件中的字符串 https://blog.youkuaiyun.com/sgs595595/article/details/70242018