[CentOS] ls returns file doesn't exist, find finds it??

Kahlil Hodgson kahlil.hodgson at dealmax.com.au
Thu Feb 24 05:03:55 UTC 2011


On 24/02/11 15:54, neubyr wrote:
> Howdy,
> 
> I am getting some errors with find and ls command - such that find is
> able to see a file whereas ls says the file doesn't exist. Initially I
> was trying find and ls together as:
> # find ./ -type f -mtime +15 | xargs ls
> 
> Similar behavior is seen even when I execute both commands separately.
> Any thoughts on what might be wrong here?

white space or weird chars could be causing problems.

try

find ./ -type f -mtime +15 -print0 | xargs -0 ls

Kal



More information about the CentOS mailing list