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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
find . -type d -exec touch {}/file$RANDOM \;-type d matches just directories and therefore makes sure
findonly does the-execcommand 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.