I am trying to copy a (.html) file from a Windows XP Professional shared folder onto a server running Ubuntu Linux 10.04 LTS.

As it's a shared folder the usual 'wget' doesn't seem to work. I suspect I'm using the wrong address style completely.

I have tried:

  2. //
  3. smb://
  4. //

I wondered if this is even possible and if it is, could someone give me some pointers?

I've successfully pinged the Windows box from Ubuntu:

# ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=128 time=0.412 ms
64 bytes from icmp_seq=1 ttl=128 time=0.557 ms (DUP!)
64 bytes from icmp_seq=2 ttl=128 time=0.243 ms
64 bytes from icmp_seq=3 ttl=128 time=0.251 ms
64 bytes from icmp_seq=4 ttl=128 time=0.266 ms

and I can access the Windows share from every other computer on the network, however, they are all running Windows XP Professional aswell. I'm not sure if it's a problem between Ubuntu and Windows shares in general or just that my URL style is wrong.


If you want to use the GUI, try clicking Places -> Connect to Server.... For Service Type choose Windows share, and fill out the fields like so:

Share: SharedFolder

Then download your file from the window. If you want to use a command-line interface, smbclient uses a FTP-like interface (get, put, etc.):

~$ smbclient //
smb: \> get Data.html

Alternatively, you could mount the share as a CIFS filesystem: (First, ensure that cifs-utils is installed)

~$ sudo mount -t cifs // /mnt

If your share requires authentication, provide the username to smbclient with the -U option, or to mount with -o user=username

  • 1
    The smbclient option worked a treat, is there anyway of scripting this? I need to get the file every minute or so. Can I just use a bash script with the smbclient command, then my root password followed by get Data.html? Oh, and exit to come out of the smbclient?
    – dannymcc
    Apr 5 '12 at 21:15
  • 6
    Storing your password anywhere is a bad idea. However, if you wanted to, you could do smbclient -A authfile //IP/Share -c 'get Data.html' and have your credentials stored in a file with root-only permissions (chmod 600). See the manpage for details on -A Apr 5 '12 at 21:27

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.