Page 1 of 1

UNIX find command

PostPosted: Sat Oct 22, 2016 10:52 pm
by tcpipman
I am trying to find all the world readable files on my system and then pipe the output to an LS command. However when I try to use the EXEC switch it fails... I am not sure what I am doing wrong here.

:/ftssuser/ctc03(63):>find ~ -perm -o=r -exec ls -al {}
FSUM6506 find: non-terminated "-exec" argument list
Usage: find directory ... expression


http://www.ibm.com/support/knowledgecen ... 0/find.htm

Here is the book entry for the find command ... I am sure I'm missing a terminating chracter.

If I drop the -exec I get the results I am expecting but I am missing the RWX bits and if it is a symbolic entry or not.

Re: UNIX find command

PostPosted: Sun Oct 23, 2016 6:19 am
by Robert Sample
The manual you linked to explicitly states that -exec requires a terminating semicolon (which needs to be escaped, it looks like). The manual also says to use white space around it. The find command you posted does not have any semicolons.

Re: UNIX find command

PostPosted: Mon Oct 24, 2016 10:41 pm
by tcpipman
Yeah I saw that and got further however now I get an entire ls listing .. basically skipping the {} .

Re: UNIX find command

PostPosted: Mon Oct 24, 2016 10:53 pm
by tcpipman
Ok I just figured out what I was doing wrong .. the root directory I was searching was also world read .. why I dont know .. but basically it was displaying all the contents of the directory then the individual files. Thanks for the help