Linux Commands&Tips

Tips

文件操作

  • 根据名字查找文件
    https://www.cnblogs.com/Baron-Lu/p/6991269.html
    find /home/lijiajia/ -name ‘*elm’

  • 批量替换文件中的字符串:
    sed -i “s/len/size/g” `grep len -rl ./`

  • 批量修改文件名

    • for name in ls *.html;do echo $name ${name%.html}.jpg;done
    • ls jpg|sed -r 's#(.).jpg#mv & \1.mp4#’|bash
    • rename txt jpg *

你可能感兴趣的:(Linux,find,linux)