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
  • 66,199
  • 35
  • 114
  • 250
Dave
  • 2,348
  • 21
  • 54
  • 84

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,333
  • 3
  • 63
  • 84
  • 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