Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I got lots of warnings when I search a certain file under a directory with lots of dangling links. I tried to use the -nowarn option to get rid of the warnings but in vain. The warnings I get look like:

find: ./foo/bar: No such file or directory
share|improve this question
1  
Could you specify which operating system's version of find you are using, and give the exact command line. I tried a simple example and didn't get any warnings for dangling symlinks. –  Peter Eisentraut Jan 26 '10 at 11:20
    
I guess you are not using the command correctly, but you really have to give further information for something helpful. –  phunehehe Jan 26 '10 at 11:34
    
As well as the OS/find versions, specifying the command lines you have tried would be helpful. Some sample output from these commands and ls -l for the directory in question may also help. Detailed questions make it easier for respondents to give relevant answers. –  David Spillett Jan 26 '10 at 11:40
add comment

1 Answer 1

up vote 2 down vote accepted

You could redirect stderr to /dev/null like these examples:

find . -type f 2> /dev/null
find . -type f -print0 2> /dev/null | xargs -0 ls -l

though the concern here would be that you are ignoring all errors reported on stderr by find, so removing the dangling symlinks if they are not needed (they might be required if they refer to filesystems that are not mounted right now but will be later, for instance, but if there is not reason for them to be present then get rid of them rather than trying to hide warnings about them) would be the first choice of solution.

share|improve this answer
    
If you just want to get rid of the warnings (i.e not fixing them) this should be enough –  phunehehe Jan 26 '10 at 11:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.