Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ok. I had the linux admins create a folder that I can see in the command line that has the contents of the Windows shared folder(windows). Ok, Im trying to copy a file from the "\dir1\reports" in linux to a folder in Windows "windows/files". I'm a little confused but since I gave names of folder maybe I will be able to understand the syntax better now.The filename will be called "new.xlsx". NOW.........since I gave names of paths to folders and the file name I should be able to understand it better. Knowing this, can you please provide the syntax again
Without knowing how your network is configured it is somewhat difficult.. The share name and the true directory structure are not necessarily the same thing. To see browseable shares you can use the -L option
smbclient -L windows_server (press enter when prompted for a password)
If the share is really named files then try:
Code:
cd /dir1/reports
smbclient //windows_server/files -U windows_user_name -c "put new xslx"
Ok let me start from the beginning cause I think I got myself confused. I am trying to copy a file from linux to windows and the linux admins told me to use "smbclient". I find this confusing because I can navigate to the folder from linux command line. The linux admins created a folder in linux that has the windows folders and files and we will call it "WINDOWS" and I want to copy to a folder called REPORTS. The path would be "/dir1/dir2/WINDOWS/REPORTS.
The location of the file to copy in he linux folder is called "file.xlsx". The location in linux is "/dir1/dir2/file.xlsx"
OK......8.)...............NOW what would the syntax be?
Personally I think the linux admins are telling me wrong. I should be able to use "cp" or "mv" cause I can navigate to the windows shared folder with no problem
@ michaelk...............yes I can confirm that the windows directory is mounted. I just do not understand why I cannot use mv or cp. I should not need to use smbclient.
Well I figured if I can copy a file to a windows shared folder in FileZilla (linux to windows) I should be able to do it from the linux command line, right?
Ifound out that the Windwos shared folder uses CIFS to mount Linux to Windows. Is there certain commands I can use to transfer files from Linux to Windows using CIFS?
Ifound out that the Windwos shared folder uses CIFS to mount Linux to Windows. Is there certain commands I can use to transfer files from Linux to Windows using CIFS?
@BW-userx.............I appreciate the info, but I really didn't see anything that would help me as far as the syntax for copying a files from Linux to Windows. Can you please give me an example how to do this using CIFS. I'm not familiar with CIFS
Ifound out that the Windwos shared folder uses CIFS to mount Linux to Windows. Is there certain commands I can use to transfer files from Linux to Windows using CIFS?
Yes, the cp command.
cp file /dir1/dir2/WINDOWS/REPORTS
You can use your file browser too...
CIFS is a Windows networking protocol for sharing files and printers. samba is the linux implementation of the CIFS networking protocol. When a Windows share is mounted it appears like any other mounted filesystem and you can use regular terminal commands.
@BW-userx.............I appreciate the info, but I really didn't see anything that would help me as far as the syntax for copying a files from Linux to Windows. Can you please give me an example how to do this using CIFS. I'm not familiar with CIFS
they gave you step by step instructions on how set it up and connect it.
how to move or copy files from one place to another is simple.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.