Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
12-09-2016, 10:24 AM
|
#16
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: 
|
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
|
|
|
12-09-2016, 10:35 AM
|
#17
|
Moderator
Registered: Aug 2002
Posts: 26,856
|
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"
|
|
|
12-09-2016, 10:39 AM
|
#18
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: 
|
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?
|
|
|
12-09-2016, 10:40 AM
|
#19
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: 
|
sorry if I repeated myself
|
|
|
12-09-2016, 10:43 AM
|
#20
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: 
|
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
|
|
|
12-09-2016, 10:58 AM
|
#21
|
Moderator
Registered: Aug 2002
Posts: 26,856
|
Yes, since as you stated the the windows directory is actually mounted. You can verify by just looking at the output of the df or mount command.
|
|
|
12-09-2016, 12:24 PM
|
#22
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: 
|
@ 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.
|
|
|
12-09-2016, 12:51 PM
|
#23
|
Moderator
Registered: Aug 2002
Posts: 26,856
|
Have you tried using cp? Do you have permissions to write to the directory?
|
|
|
12-09-2016, 01:22 PM
|
#24
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: 
|
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?
|
|
|
12-09-2016, 02:56 PM
|
#25
|
Moderator
Registered: Aug 2002
Posts: 26,856
|
Not necessarily. FileZilla uses either sftp or ftp which is a different protocol then CIFS.
|
|
|
12-12-2016, 06:58 AM
|
#26
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: 
|
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?
|
|
|
12-12-2016, 07:01 AM
|
#27
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
Quote:
Originally Posted by trickydba
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?
|
look here,
Sharing Windows files with the Linux CIFS client
and here,
How to Share Files Between Windows and Linux
|
|
|
12-12-2016, 07:22 AM
|
#28
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: 
|
@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
|
|
|
12-12-2016, 07:44 AM
|
#29
|
Moderator
Registered: Aug 2002
Posts: 26,856
|
Quote:
Originally Posted by trickydba
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.
|
|
|
12-12-2016, 08:01 AM
|
#30
|
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342
|
Quote:
Originally Posted by trickydba
@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.
Code:
cp -v /source/file /destination/
mv -v /source/file /destination/
it is that simple.
you're just adding more directories/folders to work out of is all.
Last edited by BW-userx; 12-12-2016 at 08:11 AM.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 07:12 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|