Recursive touch


Recursive touch

Published on Sat 30 Jun 2007 06:06 ( 3 years, 2 months ago)
Shell script Linux/Unix

"touch" is a unix command used to change the time of a file or directory, touch a directory will not touch the files inside.

To touch recursively, it's simple with the help of "find" and "xargs":

e.g.



find . | xargs touch

will touch all files and directories recursively under current directory.

Since directory or filename may contain spaces, the shell script need some additional parameteres:



find "$1" -type f -print0 | xargs -0 touch


Related posts:


Search related in web:

Custom Search

RSS Feed

One click subscribe this blog in your google reader!

Be social!


Want to say something here? please sign in



Blog posts link to this page
What are friends tweeting?
Tags cloud
Monthly Archives