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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

output of find

Status
Not open for further replies.

pavNell

Technical User
Sep 27, 2002
178
US
I use the find command in some of my scripts. For instance,
find /someDir -user $USER -type d -print
to list directories that belong to myself. For output, I get a lot of "permission Denied" error messages and then the list of directories that I want. How do I suppress the output of the error messages and just print what I want?
Thanks.
 
find /someDir -user $USER -type d -print 2> /dev/null
 
Thanks for the reply marsd,
now, to print the results into a file for future evaluation, I would add the "-printf filename" argument to my find command.

find /someDir -user $USER -type d -printf filename 2> /dev/null

Just what I was looking for, Thanks again!!
 
what's this 'printf' ??
prepend a '>' to 'filename'
do you really need the '-print' option??? vox clamantis in deserto.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top