Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

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.