UNIX find command



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

UNIX find command

Postby tcpipman » Sat Oct 22, 2016 10:52 pm

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.
tcpipman
 
Posts: 18
Joined: Tue Sep 22, 2015 2:03 pm
Has thanked: 4 times
Been thanked: 0 time

Re: UNIX find command

Postby Robert Sample » Sun Oct 23, 2016 6:19 am

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.

These users thanked the author Robert Sample for the post:
tcpipman (Mon Oct 24, 2016 10:54 pm)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: UNIX find command

Postby tcpipman » Mon Oct 24, 2016 10:41 pm

Yeah I saw that and got further however now I get an entire ls listing .. basically skipping the {} .
tcpipman
 
Posts: 18
Joined: Tue Sep 22, 2015 2:03 pm
Has thanked: 4 times
Been thanked: 0 time

Re: UNIX find command

Postby tcpipman » Mon Oct 24, 2016 10:53 pm

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
tcpipman
 
Posts: 18
Joined: Tue Sep 22, 2015 2:03 pm
Has thanked: 4 times
Been thanked: 0 time


Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post