recursively copy directory with smbclient

When using smbclient to copy a directory, make sure to use the recurse and prompt commands. This makes it possible to non-interactively copy a directory and all of its contents:

smbclient -Udomainname/fordodone //
Domain=[DOMAINNAME] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
smb: \> cd testdir
smb: \testdir\> get C
NT_STATUS_FILE_IS_A_DIRECTORY opening remote file \testdir\C
smb: \testdir\> prompt
smb: \testdir\> recurse
smb: \testdir\> mget C
getting file ...

use smbclient to connect to CIFS share from linux

To connect to a Windows network drive, or CIFS share, you can use a simple Linux utility called smbclient. This is much faster than trying to map a network drive through Windows. You can use this simple tool to test that the file server is working correctly.

# smbclient --user="DOMAIN\fordodone" //
Enter DOMAIN\fordodone's password:
Domain=[DOMAIN] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
smb: \> 

You can use commands like cd, ls, cp, etc. to interact with the share (similar to FTP).