User Tools

Site Tools


linux_tools

**This is an old revision of the document!**

文件批量重命名

  • 例如把后缀名从 bkscr 改成 txt。注意:如果文件名中有space,则一定要加双引号
for i in *.bkscr ; do
mv -v "$i" "${i%.bkscr}.txt"
done

The auto-run script in bash shell:

  • on Mac: ~/.profile

批量中文编码转换 GB18030 到UTF-8

find *.txt -exec sh -c "iconv -f GB18030 -t UTF-8 {} > {}t" \;
for i in *.txtt ; do
mv -v "$i" "${i%.txtt}.txt"
done

gzip

  • 圧縮 tar -zcvf xxxx.tar.gz directory
  • 解凍 tar -zxvf xxxx.tar.gz

Crontab 定时运行脚本

linux_tools.1652498770.txt.gz · Last modified: 2022/05/14 11:26 by admin