您的位置:首页 > 博客中心 > 网络系统 >

Linux-命令-基本-find-xargs-exec

时间:2022-04-03 13:19

命令: find <path> [option]

参数:

-type: f 文件 d 目录

-name: 文件或目录名

-exec: 对查找到的结果执行什么动作.

    e.g.  find . -type f -name ‘abc.txt‘ -exec {} \;   {} 代表前面所找到的内容

    e.g.  find . -type f -name ‘ *.txt‘ | xargs rm -f   *为通配符

        使用*作为通配符,如find结果为 a.txt b.txt

        使用管道向 rm 专递找到的结果,使用xargs 做为一行进行删除,等于 rm -f a.txt b.txt

        技术分享

 

热门排行

今日推荐

热门手游