Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to list the details of all the directories in my music folder using the following command:

ls -lh "$(find /music -type d)"

However all I get is the return of the find command. Is this syntax correct? I'm using ubuntu server 10.04. I think I remember a few weeks ago trying this on gui ubuntu 10.04 and it seemed to output the details of the ls command

share|improve this question
up vote 4 down vote accepted

It works, without the quotes

ls -lh $(find /music -type d)

With the quotes ls -l sees the find as a single file rather then a list of items. Look closer at the output , do you not see

ls: cannot access ...
list of find results
last item : No such file or directory
share|improve this answer
Yeah, what caught me off guard is my file names contain spaces so I can't do an ls on the return of the find command – user784637 Jan 7 '12 at 6:42
There is a discussion here… that covers files with spaces – bodhi.zazen Jan 7 '12 at 6:58

Your Answer


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.