Linux 'find' question... damn find crap doesn't work.

notfred

Lifer
Feb 12, 2001
38,241
4
0
doesn't work -> find / -user username -atime -14 -exec ls -la {};

gives this error -> find: missing argument to `-exec'

What the hell am I doing wrong? Yes, I read the man pages... I'm stumped.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
The toughest part of -exec for me is remembering the \; at the end. Other than that it looked fine to me.

If it makes you feel better I just tried it and it worked just fine.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You need to escape special characters that might be processed by the shell you're using I usually type it like this 'find / -user username -name '*regexep*' -exec do_something \{\} \;'

Since bash uses ; to seperate commands, and if *regexp* matches files in the current dir it'll expand that too, unless you quote it.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0


<< You need to escape special characters that might be processed by the shell you're using I usually type it like this 'find / -user username -name '*regexep*' -exec do_something \{\} \;'

Since bash uses ; to seperate commands, and if *regexp* matches files in the current dir it'll expand that too, unless you quote it.
>>



Yeah, thats basically what I said. And thats how I got it to work. I got a different error when I didnt include the "\" though, is the error notfred mentioned the one BASH gives (I dont have BASH :D)?