Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am totally new to Unix. I am writting a script which will copy files from a Windows shared folder to Unix.

In Windows, when I type \\Servername.com\testfolder in Run command I am able to see testfolder. The directory testfolder is a shared folder through the whole network.

Now I want to copy some files from that testfolder to a Unix machine. Which command should I use? I know the IP Address of server but I don't know the username.

share|improve this question

3 Answers 3

up vote 0 down vote accepted

From your UNIX server you need to mount the Windows share using the procedure laid out in this link.

Basically you create a directory on your UNIX machine that is called the mount point. You then use the mount command to mount the Windows share on that mount point. Then when you go to the directory that you have created you see the files that are in the Windows share.

share|improve this answer
    
thanks John. i will try this. –  Nalu Jan 18 '13 at 21:02

If you can see \Servername.com\testfolder in Windows machine, then you can use your own username and password.

On a linux machine, you can use

sudo mount -t cifs -o username=YourWindowsLogin,password=YourWindowsPassword //Servername.com/testfolder /mnt/testfolder

/mnt/testfolder must exist beforehand.

Then you can copy file from /mnt/testfolder.

Use sudo umount /mnt/testfolder to unmount the folder.

share|improve this answer

With smbclient installed on the *nix machine, you don't need to mount the Windows share at all. For example, to retrieve C:\Directory\file.txt and copy it to /tmp on your Linux computer do this:

smbclient '//windowsserver/c$' -c 'lcd /tmp; cd Directory; get file.txt' -U administrator%password

See http://superuser.com/a/562728/48742 for details. This was discussed over there.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.