How to upload a file from Windows machine to Linux machine using command lines via PuTTy?
I'm running Windows on my laptop at the moment and I want to up开发者_运维技巧load files from my laptop to my uni's general purpose server, which runs both Linux and MacOSX.
So, I already opened up a connection to that server using PuTTy. But I failed to trying to upload a file from my laptop to that server using the commands guided in this website: http://news.metaparadigma.de/linux-upload-and-download-via-ssh-terminal-226/. Seems like it only works for Linux to Linux machine. It didn't recognize the Windows path that I entered (i.e. C:\a.txt).
How can I do this?
Try using SCP on Windows to transfer files, you can download SCP from Putty's website. Then try running:
pscp.exe filename.extension username@domainname.com:directory/subdirectory
There is a full length guide here.
Pscp.exe is painfully slow.
Uploading files using WinSCP is like 10 times faster.
So, to do that from command line, first you got to add the winscp.com
file to your %PATH%. It's not a top-level domain, but an executable .com
file, which is located in your WinSCP installation directory.
Then just issue a simple command and your file will be uploaded much faster putty ever could:
WinSCP.com /command "open sftp://username:password@example.com:22" "put your_large_file.zip /var/www/somedirectory/" "exit"
And make sure your check the synchronize folders feature, which is basically what rsync
does, so you won't ever want to use pscp.exe again.
WinSCP.com /command "help synchronize"
Use putty. Put install directory path in environment values (PATH), and restart your PC if required.
Open cmd (command prompt) and type
C:/> pscp "C:\Users/gsjha/Desktop/example.txt" user@host:/home/
It'll be copied to the system.
Better and quicker approach without any software to download.
- Open command prompt and follow steps mentioned below
- cd path/from/where/file/istobe/copied
- ftp (serverip or name)
- It will ask for Server(AIX) User: (username)
- It will ask for password : (password)
- cd path/where/file/istobe/copied
- pwd (to check current path)
- mput (directory name which is to be copied)
This should work.
精彩评论