Tags

, , , , , ,

Today, I had to do a long list of files inside a folder recursively. I tried using

find <folder> | xargs ls -l

This failed miserably when the folders/files inside the search location had space character in it. Searched for sometime and came across:

find <folder> -print0 | xargs -0 ls -l

Its kool..

-print0 prints null character as line delimiter and -0 (for xargs) takes null character as line delimiter and passes that input to ls.. Nice one 🙂

Advertisements