Linux helpful commands
Written by
荒岛书生
on
To introduce some helpful commands in Linux(ubuntu 18).
StartTime: 2018-03-14,ModifyTime:2018-07-10
- 批量删除一个目录以及子目录下的 html 文件
find . -name "*.html" -exec rm -r "{}" \;
2. 批量修改一个文件夹下面所有文件的后缀名为 .jpg
for i in `ls`; do mv -f $i `echo $i | sed 's/.....$/.jpg/'`; done
- 列出磁盘的容量和占用情况
df -h
- use htop or top tool watch which program use unnormal resource of computer, and kill it by this command:
htop top kill -9 PID
- 列出当前 folder 的 folders 大小:
sudo du -h --max-depth=1