Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know, whether is it possible to access the Windows files from a shell script on Linux system ? What i am trying to do is to run a shell script in my Linux system, that will access the files of a remote Windows system, read them and manipulate them. Forget about the file and folder permissions.

Is it possible to do this using the Linux shell scripts (or perl scripts)?

share|improve this question
up vote 9 down vote accepted

Yes, you can mount a windows share into the linux filesystem using mount.cifs e.g.

mkdir /mnt/windowsfs
mount -t cifs //server/share -o username=user,password=P4ssw0rd /mnt/windowsfs

Once you've done that you can (with suitable permissions) access and manipulate the files in /mnt/windowsfs.

share|improve this answer

Mounting the remote share is the most direct approach. However, there's also the smbclient executable, that gives FTP-like access to remote shares. It's a part of the Samba software package.

share|improve this answer

Your Answer


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.