You could pipe the output of your command through grep
, looking for lines that end with /
.
smbclient ... | egrep '/$'
Instead, you could mount the remote windows file system and then use the find command to search for folders. The find command will search recursively for all directories only. This would be my recommended approach. Assuming you mount the windows filesystem as /mnt/win_host
...
find /mnt/win_host -type d