Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

On Linux, how would I recursively traverse a variable number of shares?

share|improve this question

migrated from Jul 22 '09 at 15:39

This question came from our site for professional and enthusiast programmers.

What language. is "find . -type d" is a good start for shell scripting. – slacy Jul 22 '09 at 3:59
Are shares mounted? If not you can use smbclient. – Eugene Jul 22 '09 at 4:33
You need to add more detail to the question so it actually means something :). We can guess what you mean and give you nik's answer but we don't actually know what you want yet. – James Jul 22 '09 at 15:43

I just answered your other question.
The generic directory traversal from a point above the shares would be,

find . -type d -exec ls -ld {} \;

This will enumerate all the directories under your base directory.

You could however, run this individually over a list of the shared directories to get separated results.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.