Linux helpful commands

To introduce some helpful commands in Linux(ubuntu 18).

StartTime: 2018-03-14,ModifyTime:2018-07-10

  1. 批量删除一个目录以及子目录下的 html 文件
     find . -name "*.html" -exec rm -r "{}" \;
    

2. 批量修改一个文件夹下面所有文件的后缀名为 .jpg

for i in `ls`; do mv -f $i `echo $i | sed 's/.....$/.jpg/'`; done
  1. 列出磁盘的容量和占用情况
    df -h
    
  2. use htop or top tool watch which program use unnormal resource of computer, and kill it by this command:
    htop
    top
    kill -9 PID
    
  3. 列出当前 folder 的 folders 大小:
    sudo du -h --max-depth=1
    
您如果觉得有用,觉得写得还不错,可以一元赞赏作者。
   
微信捐赠图片
   
支付宝捐赠图片