Friday, March 29, 2013

Copy file/directory from Linux Cent OS to Window shared folder

1. Install with Samba client in Linux
yum install samba-client

2. Install with cifs-utils
yum install cifs-utils

3. Create a directory in Linux Cent OS (i named it as "shared")
mkdir /mnt/shared

4. Add in some line in fstab
vi /etc/fstab

# Mount Windows Share to /mnt/shared
[Window IP]:/[shared_folder_path] /mnt/shared cifs username=[window username],password=[window password] 0 0

5. Run the command below:
mount -a

6. Copy a file from Linux Cent OS to Window shared folder.

normal copy: cp -r [source] [destination]
e.g. cp -r [source path from linux centos] /mnt/shared

copy and overwrite existing copy: yes | cp -rf [source] [destination]
e.g. yes | cp -rf [source path from linux centos] /mnt/shared

7. Check from the shared folder to see the file/directory that copied.



No comments: