Recursivly add new files in subfolders
I want to add recursivly new file. This is folder structure "a/b/c/d/e". When i use this
find . -exec touch file$RANDOM {} \;
I开发者_开发问答 want to get in folder a: file61 and b; in b: file79 and c; etc. But it doesnt work and make only new file in a
find . -type d -exec touch {}/file$RANDOM \;
-type d matches just directories and therefore makes sure find
only does the -exec
command for directories.
{}
(the matched filename) needs to be up front since otherwise the -exec command executes the command from the directory find was run from.
精彩评论