• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

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

notfred

Lifer
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.
 
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.
 
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.
 


<< 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 😀)?
 
Back
Top