Download a file from remote server in UNIX - unix

I have a file on a remote server that I can connect to via ssh. I would like to copy the file from the remote server at the path: '/home/example.txt' to my computer's desktop.
Should I be using wget, sftp, ftp, or simply rm?
Bonus points if you know a good resource for UNIX documentation, since google's results were not great.

Use scp(1):
~$ scp user#host:/home/example.txt .

None of them, you should use scp

scp or rcp if you don't want/need to be secured. Or alternatively rsync will be nicer for anything more complicated with remote file transferring on a regular basis.
For the documentation, look at the man pages, ex: man scp. Or online at
http://linux.die.net/man/1/scp
http://linux.die.net/man/1/rcp
http://linux.die.net/man/1/rsync

Try Filezilla Utility
More info on http://filezilla-project.org/

Related

How to copy file from desktop to unix using ssh terminal command

I am trying to copy a file called TEST.txt from my desktop to Unix server using SSH client. What command would I use to accomplish this task?
Many thanks!!
You need to use scp, like so:
scp /file/to/send username#remote:/where/to/put
Take a look here for more help: https://unix.stackexchange.com/questions/188285/how-to-copy-a-file-from-a-remote-server-to-a-local-machine
I assume you are running a Windows desktop. You can use the SFTP tool in PuTTy or FileZilla to copy files using your ssh credentials.

File transfer between local folder and remote URL using WebDAV

I want to move files from local folder to remote URL in a scheduled way using WebDAV.
I found this URL useful but this shows the script to transfer only single file, instead I want to transfer all files from a local folder to remote URL through winscp using WebDAV protocol:
http://winscp.net/eng/docs/guide_automation
Any pointers for this would be helpful.
Use the following WinSCP script:
open http://user:password#example.com/
put d:\path\* /home/user/
close
Read about file masks.
If you really need to move files (as opposite to copy), add the -delete switch to the put command:
put -delete d:\path\* /home/user/
For scheduling, see the WinSCP guide to scheduling file transfers.

Transferring a file through the CLI on the same network

I have a file on my desktop and I need to get it onto another server, but I have no means of getting it there, i.e. email/usb or any way like that.
The server is on the same network as me.
I have heard of a way that the file can be copied via the command line.
Would anyone have any information on this and if so could you please help me?
Not sure whether you have command line access to that server or not? If yes, are you accessing it via telnet or via ssh?
If ssh, you should be able to transfer the file via SCP (secure copy), since it uses the same ssh connection you use to get your cli. If you want to transfer your file from a Windows environment, you may want to look at WinSCP, else do a man scp on your Linux or Unix server and, assuming you have it, you'll get the hang of it... it's not complicated.
If ssh is not an option, then you depend on the server having some service available for you to transfer the file, most obvious one being FTP.
Does that help?

Example SFTP batch upload script for AS400 server to upload to a Unix SFTP server

Suppose I have a file called helloworld.txt on an AS400 and I want to write a script to automate the daily upload of the source file helloworld.txt on an AS400 server to upload to a Unix SFTP server, say sftp://exampleunixsftp.com?
Does someone have such a script? Is OpenSSH the only tool that can be used on the AS400 to get this accomplished or are there any other methods? If LFTP could be installed on the AS400, that would be an easy solution but since it's only for Unix/Linux/Win/Mac then I don't have this option. I read Scott Klement's article at:
http://systeminetwork.com/article/ssh-scp-and-sftp-tools-openssh
I just need an example basic script to get this done. I'd appreciate this.
The MidrangeWiki topic on SSH has some information and examples that may be helpful.
sftp is intended primarily as an interactive utility. scp performs the same function non-interactively.
The command, once authentication is set up, would simply be:
scp helloworld.txt username#exampleunixsftp.com:<destination path>
LFTP can be installed with some preparation in the PASE environment. See Open Source Binaries. Currently offline. Use the Google cache.

automate sftp upload process

I'm looking for a way to upload files/dirs structure from one server to another..
The only way it's possible in my case is SFTP upload, is there any easy way to upload it, using script or something without making archive of files/dirs, I want to recreate on remote server?
Thank you!
Perhaps a solution could be found using recursive scp (scp -r)? Or are you limited explicitly to sftp only?
There's also a client named lftp which has sftp and scripting support - much like batch file I would imagine - a list of ftp commands. (http://lftp.yar.ru/lftp-man.html)
You may want to consider Syncplify.me FTP Script! as a solution. It allows you to write very simple scripts to achieve your goal.
For example, uploading an entire directory to a remote SFTP server would actually be a single line of code added to one of the ready-made templates.
http://www.syncplify.me/products/ftp-script/
edtFTPj/PRO is a Java SFTP client that has a comprehensive scripting engine. Being Java you can run it on any platform where Java is supported.
Here's some more details on the scripting support. It has an 'mput' command that uploads all the files in the current directory to the remote directory.
Recursive transfers aren't yet supported, but could easily be added if required - email support if you are interested.

Resources