UNIX find command

Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories
tcpipman
Posts: 18
Joined: Tue Sep 22, 2015 2:03 pm
Skillset: Networking, Security, REXX, RACF
Referer: Internet

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.

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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.

tcpipman
Posts: 18
Joined: Tue Sep 22, 2015 2:03 pm
Skillset: Networking, Security, REXX, RACF
Referer: Internet

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
Skillset: Networking, Security, REXX, RACF
Referer: Internet

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


  • Similar Topics
    Replies
    Views
    Last post