How to Upload a File via SSH and Command Line
scp ~/Downloads/NestedT.png root@64.207.144.103:/var/www/vhosts/davidwalsh.name/httpdocs/demo
My preference for daily work is usually GUI applications, like Visual Studio Code for text editing and Cyberduck for remote file server management. I'm also a huge fan of automation, so I do try to learn the command line equivalents of UI functions. My latest desire was wanting to know how to upload a file via SSH from command line.
To upload a file to a remote server from command line, use scp
and the file path with the remote destination:
scp path/to/local/file.png user@hostname:/path/to/upload/
I'll be honest: I'll probably still use a GUI for personal uploading, but knowing how to upload via automation is still super valuable!
![Page Visibility API]()
One event that's always been lacking within the document is a signal for when the user is looking at a given tab, or another tab. When does the user switch off our site to look at something else? When do they come back?
![CSS Gradients]()
With CSS border-radius, I showed you how CSS can bridge the gap between design and development by adding rounded corners to elements. CSS gradients are another step in that direction. Now that CSS gradients are supported in Internet Explorer 8+, Firefox, Safari, and Chrome...
![Create a Dojo-Powered WordPress Website View]()
Yesterday I showed you WordPress' awesome JSON plugin named JSON API. Now that I can get my blog posts in JSON format, it's time to create an awesome AJAX'ed web app with that data. I've chosen to use the power of Dojo and Dijit to...
![PHP IMDB Scraper]()
It's been quite a while since I've written a PHP grabber and the itch finally got to me. This time the victim is the International Movie Database, otherwise known as IMDB. IMDB has info on every movie ever made (or so it seems). Their...
Its worth noting that scp is considered deprecated.
https://lwn.net/Articles/835962/
I’ve moved to rsync for all of my needs in this regard.