4

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)?

shasi kanth
  • 179
  • 1
  • 3
  • 11

3 Answers3

9

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.

user9517
  • 115,471
  • 20
  • 215
  • 297
1

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.

Joachim Sauer
  • 840
  • 5
  • 19
0

Install this command on linux

 sudo apt-get install cifs-utils

and

mkdir /mnt/windowsfs

sudo mount.cifs //WindowsPC/Share /mnt/windowsfs -o user=geek

its ask for password, enter password then check your /mnt/windowsfs folder...its Done.

Anmol Mourya
  • 101
  • 1