I’m using Amazon Linux, bash shell. I’m trying to write a statement that will delete all child directories named “target” within a specific master directory. I would like to write things such that even if the directories don’t exist, there is no error thrown. I tried the below but I’m getting an error
[jboss@mydevbox ~]$ find ~/.jenkins/jobs/subco/workspace/myproject/ -name 'target' -print0 | xargs rm -rf xargs: Warning: a NUL character occurred in the input. It cannot be passed through in the argument list. Did you mean to use the --null option?
What is a better way to write the above?