Index 目录

  • du
  • find
  • iconv
  • screencapture (only for mac)
  • 查看、kill 端口

du

查看磁盘空间占用

  1. du -sh *

find

  1. find ./ -name '*.png'

iconv

可用于修改单个或批量文件的编码

  1. iconv --list # 显示可识别的编码名称
  2. iconv --list > ./infomation.log # 显示可识别的编码名称,将信息存入infomation.log文件中
  3. iconv -f GB2312 -t UTF-8 xxx.txt > zzz.txt # 转换 GB2312 编码的文件 xxx.txt 为UTF-8编码,存入 zzz.txt
  4. iconv -f GB2312 -t BIG5 a.html > b.html # 转换 GB2312 编码的文件 a.html 为 BIG5 编码,存入 b.html
  5. find *.py -exec sh -c "iconv -f GB18030 -t UTF8 {} > {}.py" \;

screencapture

i 截取,w 窗口,T 延时,x 关闭声音,

  1. screencapture test.jpg # 无参数默认截屏
  2. screencapture -i ./f2.png
  3. screencapture -i -x ./f2.png
  4. screencapture -w ./ff.png
  5. screencapture -w -x ./ff.png
  6. screencapture -w -T 3 -x ./ff.png

查看、kill 端口

  1. # 查询
  2. lsof -i: portID
  3. # kill
  4. kill -9 portID

Extra 其他扩展包

  • unrar

unrar

  1. unrar x filename.rar