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


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
  • 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 askubuntu.com/questions/91072/… that covers files with spaces – Panther Jan 7 '12 at 6:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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