Date: Mon, 24 Sep 2001 09:38:38 +1000 From: Tony Landells <ahl@austclear.com.au> To: Nathan Mace <mace_nathan@uchaswv.edu> Cc: freebsd-questions <freebsd-questions@FreeBSD.ORG> Subject: Re: 'find' question Message-ID: <200109232338.JAA11204@tungsten.austclear.com.au> In-Reply-To: Message from Nathan Mace <mace_nathan@uchaswv.edu> of "Sun, 23 Sep 2001 19:02:26 -0400." <20010923190226.3d62ec9c.mace_nathan@uchaswv.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
mace_nathan@uchaswv.edu said: > is there a way to use find to print out a list of files and > directories that are writable by a certain user? for example if my > user name was "nathan" and i wanted a list of every directory that i > had rights to right to how would i run that command? i read the find > man page, and i think it's possible to do this, i just don't have any > idea how. Sure. Do you want files & directories, or just directories? If you want everything, try: find / -exec test -w '{}' \; -print If you only want directories: find / -type d -exec test -w '{}' \; -print This is by far the easiest way. You could in theory do it all in find (the "-exec" spawns a shell), but you would have to enumerate all the groups you belong to and test each separately (though it could all be done in one execution of find ...). This could take a while to run on a big system. > on a side note, if this is possible, can i use "locate" instead of > find? No. Locate only searches on name. Also, locate only sees files that could be found by user "nobody". Tony -- Tony Landells <ahl@austclear.com.au> Senior Network Engineer Ph: +61 3 9677 9319 Australian Clearing Services Pty Ltd Fax: +61 3 9677 9355 Level 4, Rialto North Tower 525 Collins Street Melbourne VIC 3000 Australia To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109232338.JAA11204>