Skip to main content
1 of 3
kurramkurram D
  • 519
  • 1
  • 4
  • 11

Understand -exec command?

This works

find ./ -iname '*.c' -o -name '*.h' -o -name '*.l' -exec grep -irn test1 {} \;

If I combine -exec with ls then it tells me that is improper option.

#ls -exec touch {} \;
ls: invalid option -- 'e'
Try 'ls --help' for more information.

Is my understanding correct that -exec option is used only by find and not by other commands?

kurramkurram D
  • 519
  • 1
  • 4
  • 11