Werner Schram wrschram at
Tue Jan 26 23:17:05 UTC 2010

nepal wrote:
> On Tuesday 26 Jan 2010 21:03:53 Linda wrote:
>> Is there a way to make ls silent if there is no match? I'm not
>>  finding  it in the options, but am hoping I'm just reading over it
>>  in the man page. Thanks
>>           Linda
> Hi Linda
> File a bug report!
> The correct response to *ls* for a non-existent target should be an 
> empty list.
> nepal.
ls does print an error message if you provide a filter which doesn't 
yield a result (ls: cannot access ...: no such file or directory). I 
think she is refering to that. But because the error message is sent to 
the standard error output, you can dispose of it by using:

ls [non-existing filename] 2>/dev/null


More information about the ubuntu-users mailing list