9

Given a single SMB network share (for example, \\server\\SHARED_FOLDER), I want to recursively list all the files, including those in the subdirectories (like find(1)).

I would prefer to do it in Linux, but I also accept Windows answers.

1
  • 1
    .. assuming without mounting it?
    – slhck
    May 31, 2011 at 8:47

2 Answers 2

4

I would use:

sudo smbmount //server/SHARED_FOLDER /local/folder
cd /local/folder
ls -R

Obviously, add your preferred ls flags into the command (so, for me, I would use ls -lahR, but that's a personal preference).

0
17

Try the command: smbclient //HOST/PATH -c 'recurse;ls' PASS -U USER

2
  • smbclient //192.168.1.10/smb/tmp -c 'recurse;ls'
    – CS QGB
    Sep 15, 2022 at 11:44
  • tree connect failed: NT_STATUS_BAD_NETWORK_NAME
    – CS QGB
    Sep 15, 2022 at 11:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .