notice the double slash
You can use
vim scp://root@example.com//file
too in a simple case.
You can push files to up to 32 servers at once assuming ssh keys are in place. Great tool, it is part of the pssh suite.
the command is obvious, I know, but maybe not everyone knows that using the parameter "-l" you can limit the use of bandwidth command scp. In this example fetch all files from the directory zutaniddu and I copy them locally using only 10 Kbs
Place in .bashrc and invoke like this: "mecp /path/to/file", and it will copy the specified file(s) back to the desktop of the host you're ssh'ing in from. To easily upload a file from the host you're ssh'ing in from use this: ucp (){ scp ${SSH_CLIENT%% *}:Desktop/upload/* .; }
-C is for compression.
Lifted from http://linux.spiney.org/remote_diff_with_vim_and_ssh which points out credits for the inspiration.
While at the command line of of hosta, scp a file from remote hostb to remote hostc. This saves the step of logging into hostb and then issuing the scp command to hostc.
This command list all CPU technical infos. Show Sample Output
Just a quick and simple one to demonstrate Bash For loop. Copies 'file' to multiple ssh hosts.
Quick and dirty hardware summary where lshw is not available. Requires util-linux, procps, pciutils, usbutils and net-tools, which should be preinstalled on most systems.
This will copy a file from your current directory to the same location on another machine. Handy for configuring ha, copying your resolv.conf, .bashrc, anything in /usr/local, etc. Show Sample Output
If you are running sshd on different port use above this command to edit/view remote file with vi/vim. In above example I am using port 12345.
I often need to send screenshots to other people to explain settings and whatever. So I created this oneline which I use to create the screenshot with imagemagik, upload it via scp to my server and then the command opens an firefox tab with the screenshot. The screenshot can be a region or a window. You just have to replace the parts beginning with YOUR.
I sue this in my .bashrc file This will also do auto-completion for scp and sftp
Like vim scp://yourhost//your/file but in vim cmds.
A little messy, but functional. Requires vim >= 7.x.
The “predictive capture” feature of Sony's Xperia camera app hides the date stamp deeply inside the filename. This command adds another date stamp at the beginning of the filename. Show Sample Output
same rip P.S. B$ is computer B and so on
this is a rip from http://superuser.com/questions/276533/scp-files-via-intermediate-host
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: