现在的位置: 首页 > 综合 > 正文

如何touch一个目录及其下所有嵌套子目录中的文件?

2013年12月01日 ⁄ 综合 ⁄ 共 372字 ⁄ 字号 评论关闭

如何touch一个目录及其下所有嵌套子目录中的文件?

find  .  | xargs   touch  

或者

find ./ -type f |xargs touch
find ./ -type d |xargs touch

就可以了。

      -type c
              File is of type c:
              b      block (buffered) special
              c      character (unbuffered) special
              d      directory
              p      named pipe (FIFO)
              f      regular file
              l      symbolic link
              s      socket
              D      door (Solaris)

 

抱歉!评论已关闭.