Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help decode this find command? 1

Status
Not open for further replies.

jouell

MIS
Joined
Nov 19, 2002
Messages
304
Location
US
Hi.

Sorry for the basic question to the masters here but
I can't understand what this line is supposed to do, exactly?

find /mountpoint -fstype nfs -prune -o ! -exec ls -lad {} \;

It doesn't bring back any results, just a link:

find /prod -fstype nfs -prune -o ! -exec ls -lad {} \;

result:
"
lrwxrwxrwx 1 root root 23 2005-11-18 13:28 /mountpoint -> /rdisks/bin/prod"

Thanks!
-John




 
I think it's this:

[tt]find /prod find under /prod
-fstype nfs anything with filesystem type nfs
-prune but don't descend into it (to save time)
-o "or"
! not
-exec ls -lad {} \; execute this command[/tt]

Basically it will do an ls -lad of all files and directories that are not NFS mounts. As far as I can tell the ! / "not" is redundant and has no effect on the output there, so I'm not sure why it has been included.

Annihilannic.
 
Thanks!

That helps!

-John
 
Maybe that means execute the command on everything that's NOT an nfs mount under /proc
 
No, because that's already handled by the -o "or" logic. It only affects the "trueness" or "falseness" of the -exec part, which isn't any use because there are no further expressions following it. At least that's the way I interpret it.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top