1

I'm using Amazon Linux with bash shell. I'm trying to touch every file in a certain directory, but this command is failing:

[myuser@mymachine scripts]$ find /usr/java/jboss/standalone/deployments/myapp.war -type f -exec touch '{}' ;
find: missing argument to `-exec'

How do I correct the above?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Dave
  • 2,548

1 Answers1

3
-exec touch {} \;

or better yet the modern xargs-style

-exec touch {} +

as ; otherwise is used by the shell for conflicting purposes.

thrig
  • 34,938
  • 1
    Awesome. Posterity will note that the complete command is "find /usr/java/jboss/standalone/deployments/myapp.war -type f -exec touch {} +" – Dave Jun 07 '17 at 14:57