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.
|
![Reply](https://www.linuxquestions.org/questions/images/buttons/reply.gif) |
|
12-09-2016, 09:57 AM
|
#1
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
Copy from Linux to Windows(Samba)
Im trying to use 'smbclient' to move a file from Linux to Windows. I think I'm getting the syntax wrong. The Windows folder is visible in Linux command line, it is automounted.
|
|
|
12-09-2016, 10:00 AM
|
#2
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
If you think you are getting the syntax wrong, you should share the syntax that you are using.
|
|
|
12-09-2016, 10:01 AM
|
#3
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,538
|
If the folder is automounted then use any of the normal linux copy/move commands
|
|
|
12-09-2016, 10:31 AM
|
#4
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
Yes, I tried using 'mv' and 'cp' with no success. The Linux admin told me I should use smbclient. Which is weird being that I can see the Windows folders from the Linux command line. I tried this and it didn't work:
smbclient //dir1/dir2/dir3/dir4/windowsfoldertocopyfileto -c "get \\dir1\dir2\dir3\dir4\filetocopyinlinux.xlsx"
|
|
|
12-09-2016, 10:43 AM
|
#5
|
Moderator
Registered: Aug 2002
Posts: 26,466
|
I believe the correct syntax with specifying a username/password is:
Code:
smbclient //windows_server_NETBIOS_NAME/windows_folder_tocopy_file_from -U WINDOWS_USER%WINDOWS_PASSWORD -c "get some_file.xlsx"
I did post a similar command in your other thread...
Last edited by michaelk; 12-09-2016 at 10:46 AM.
|
|
|
12-09-2016, 10:49 AM
|
#6
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
I should have mentioned that one of the folders in the Windows path has a name that has a space
|
|
|
12-09-2016, 10:53 AM
|
#7
|
Moderator
Registered: Aug 2002
Posts: 26,466
|
Try using quotes.
Code:
... "//windows_server_NETBIOS_NAME/windows_folder_tocopy_file_from"...
|
|
|
12-09-2016, 10:54 AM
|
#8
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
I tried that.............. I get NT_STATUS_BAD_NETWORK_NAME
|
|
|
12-09-2016, 10:56 AM
|
#9
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
And remember to try to never make directories or filenames with spaces in them in the future. It complicates things unnecessarily with quotes and escapes.
|
|
|
12-09-2016, 10:57 AM
|
#10
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
Also, when I try using the ip address I get..........................NT_STATUS_LOGON_FAILURE
|
|
|
12-09-2016, 10:58 AM
|
#11
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Ah. He forgot to leave the sharename alone. Do this:
...//windows_server_NETBIOS_NAME/"windows_folder_tocopy_file_from"...
|
|
|
12-09-2016, 10:58 AM
|
#12
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
@szboardstretcher............yea the Win admins did that, expected cause Linux admins wouldn't do that
|
|
|
12-09-2016, 11:00 AM
|
#13
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
@szboardstretcher...........actually Ill be copying a file from Linux to Windows
|
|
|
12-09-2016, 11:03 AM
|
#14
|
Member
Registered: Nov 2016
Location: Atlanta,Georgia
Posts: 310
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
@szboardstretcher.............I tried your last suggestion and only got a '>' prompt
UPDATE - I had an extra " sorry. Took it out and got NT_STATUS_BAD_NETWORK_NAME
Last edited by trickydba; 12-09-2016 at 11:05 AM.
|
|
|
12-09-2016, 11:05 AM
|
#15
|
Moderator
Registered: Aug 2002
Posts: 26,466
|
You can try using a backslash to escape the space.
Are you using a valid share name?
smbclient -L windows_IP (or netbios name) Just press enter when prompted for a password.
Is the actual directory you trying to download from a sub-directory from the share? If so then you need to add a cd command
smbclient //windows_name/share_name -U windows_user -c "cd \"sub dir\"; put files"
Last edited by michaelk; 12-09-2016 at 11:23 AM.
|
|
|
All times are GMT -5. The time now is 04:34 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
|
|