LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-12-2006, 04:22 PM   #1
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Rep: Reputation: 30
what command will do this?


to upload files from my Windows PC to my Linux server over ssh i use this program that looks likea ftp client that uses ssh. i normally use putty to logon to my ssh server, and i hate openinig a seperate connection and program just to upload a file. what command can i use to upload a file from my PC (windows) to my linux server which im connected to via ssh?

another thing i'd like for convinance reasons is to know how to do something like... for instance this command i use on text files i create in windows when i upload them to linux

perl -i.bak -pe 's/\r\n/\012/' filename.ext

its alot of letters and stuff to type in. id like to create my own command so i it can be like mycommand filename.ext and it runs that. is something like that very hard to do?

Last edited by MrSako; 10-12-2006 at 04:23 PM.
 
Old 10-12-2006, 04:36 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
You can use pscp.exe to copy files to an SSH server - it's one of the programs that comes with putty. It doesn't have a GUI but it can use your saved putty sessions. For example the first command line below doesn't use a saved putty session, but the the second one use a saved session called ssh-box:
Code:
pscp bigfile.iso ssh-box.onmynetwork.com.au:/home/steve
pscp bigfile.iso ssh-box:/home/steve
For converting files on your Linux box, you can use fromdos. From man fromdos:
Code:
fromdos  takes a DOS text file as stdin and sends a UNIX text file to stdout
 
Old 10-12-2006, 08:01 PM   #3
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
dos2unix is another app that will convert your text files
 
Old 10-16-2006, 04:00 PM   #4
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
i dont think i understand how ot use pscp? i downloaded it from here http://www.chiark.greenend.org.uk/~s.../download.html

when i run it in wnidows it just opens a window and closes it.
 
Old 10-16-2006, 10:02 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
That's correct - it doesn't have a GUI so you need to run it from the command line with something like the command I used earlier.
 
Old 10-17-2006, 02:54 AM   #6
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Rep: Reputation: 30
Good Day

Download a program called "bitvise tunnelier", it opens a console and a "Windows Explorer" like FTP program to copy files, but it uses scp and ssh

Cheers
 
Old 10-23-2006, 05:09 PM   #7
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by gilead
That's correct - it doesn't have a GUI so you need to run it from the command line with something like the command I used earlier.
so i upload pscp to the server it will be used on?
 
Old 10-23-2006, 06:54 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
No - pscp.exe is the windows program that will copy files from your windows box to your SSH server. On the Linux SSH server will already be Linux executables for doing the same thing from the Linux box (scp, sftp, ssh) to other SSH servers.

EDIT: The commands in my earlier post are run on the windows box to copy files to the Linux SSH server.

Was that what you meant?

Last edited by gilead; 10-23-2006 at 07:13 PM.
 
Old 10-24-2006, 04:41 PM   #9
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
oh thats not exactly how I wanted it to work.

ie im already in putty doing stuff on my linux server messing with files etc and i realize i need to upload a file for whatever im doing

id like to just be able to type in

uploadfile c:\lala\lala\lala


versus what i do right now is i open this other program i have thats for uploading and downloading files over ssh with a ftp like gui (i dont care for the gui)

its so inconvinant (sp) to have to open a whole new program to upload a small file.

i don't think bitvise is for me it seems like the program i already have.
 
Old 10-26-2006, 03:12 AM   #10
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
The other option is to mount your windows partition into the linux box and do a normal cp of the files from the mount point to the desired directory. You can achive that with putty also.

--
Prasanta
 
Old 10-26-2006, 03:23 AM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
what about mounting via Samba (or NFS) ?
 
Old 10-26-2006, 07:34 AM   #12
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
@chrism01: that's exactly what prasanta was referring to.

And indeed, it should be fairly straight-forward:
1. On Windows, make a shared folder with appropriate permissions and a suitable name of course.
2. On Linux, you can then use "smbmount" or "mount -t smb" to mount the shared folder on your Linux box.
If you want to have it mounted each time you boot your Linux box, you could add it to /etc/fstab.
When inside PuTTY, you can then simply cp from/to the shared folder.

In your case, I recommend sharing & mounting the entire Windows disks, to avoid having to copy (on Windows) the files to the shared folder (ie again, an operation outside PuTTY) to make them available to Linux.
 
  


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
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 08:19 PM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 03:23 AM
Why after start of a command the invitation for input next command has not appeared. ukrainet Linux - General 3 06-24-2005 09:16 AM
Redirecting output to a command-line argument of another command madiyaan Linux - Newbie 1 02-19-2005 05:35 PM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 08:14 PM


All times are GMT -5. The time now is 06:27 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration