Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

find . -exec echo {} \; = missing argument to `-exec'

Tags:

find

bash

Why doesn't this work? (echo is not the real command)

$ find . -type d -exec echo {} \;
find: missing argument to `-exec'

I managed to do that anyway like this:

$ for f in `find . -type d`; do echo $f; done
like image 263
Pascal Polleunus Avatar asked May 23 '12 15:05

Pascal Polleunus


1 Answers

This work for me.

find . -type f -exec file '{}' \;

Braces are enclosed in single quote marks to protect them from interpretation as shell script punctuation.

like image 156
bakalov Avatar answered Sep 24 '22 01:09

bakalov