LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-09-2016, 10:24 AM   #16
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled

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
 
Old 12-09-2016, 10:35 AM   #17
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,381

Rep: Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469
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"
 
Old 12-09-2016, 10:39 AM   #18
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
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?
 
Old 12-09-2016, 10:40 AM   #19
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
sorry if I repeated myself
 
Old 12-09-2016, 10:43 AM   #20
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
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
 
Old 12-09-2016, 10:58 AM   #21
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,381

Rep: Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469
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.
 
Old 12-09-2016, 12:24 PM   #22
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
@ 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.
 
Old 12-09-2016, 12:51 PM   #23
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,381

Rep: Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469
Have you tried using cp? Do you have permissions to write to the directory?
 
Old 12-09-2016, 01:22 PM   #24
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
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?
 
Old 12-09-2016, 02:56 PM   #25
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,381

Rep: Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469
Not necessarily. FileZilla uses either sftp or ftp which is a different protocol then CIFS.
 
Old 12-12-2016, 06:58 AM   #26
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
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?
 
Old 12-12-2016, 07:01 AM   #27
BW-userx
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,250

Rep: Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206
Quote:
Originally Posted by trickydba View Post
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
 
Old 12-12-2016, 07:22 AM   #28
trickydba
Member
 
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310

Original Poster
Rep: Reputation: Disabled
@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
 
Old 12-12-2016, 07:44 AM   #29
michaelk
Moderator
 
Registered: Aug 2002
Posts: 24,381

Rep: Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469Reputation: 5469
Quote:
Originally Posted by trickydba View Post
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.
 
Old 12-12-2016, 08:01 AM   #30
BW-userx
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,250

Rep: Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206Reputation: 2206
Quote:
Originally Posted by trickydba View Post
@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.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows 7 freeze when copy files to Samba Tectu Linux - Server 12 04-29-2012 08:14 PM
Shell script to copy all folders older than 7 days from Linux to Windows by samba blackthu80 Linux - General 4 03-17-2011 12:29 AM
can't copy from windows to linux(samba) kaibs Linux - Software 2 02-27-2007 01:57 AM
Copy files from Windows to Samba bkesting Linux - Software 2 11-23-2004 11:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration