Perhaps you only need to upload or download a file from a host, and want the added security features of SSH. We can do so with the
To upload a file, type the command, followed by the file to transfer, then the location.
$ scp sample.txt firstname.lastname@example.org:
Remember to tack on the colon at the end - otherwise you'll find that you simply made a copy of sample.txt in your current directory called email@example.com!
To copy it back to your current directory, simply swap the targets around.
$ scp firstname.lastname@example.org:sample.txt sample.txt
You'll notice that the path following the colon is relative to the home directory (since that's where you are logged in when you
ssh into a host).
$ scp sample.txt email@example.com:Documents/sample.txt
If you want to copy somewhere other than within your home directory, pass an absolute path after the colon.
$ scp init.d firstname.lastname@example.org:/etc/init.d
To copy entire directories, pass the
-r option. Additionally, you can pass in the
-p option to preserve the timestamps and permission settings.
$ scp -rp mail email@example.com
This foam seat cushion relieves lowerback pain, numbness and pressure sores by promoting healthy weight distribution, posture and spine alignment. Furthermore, it reduces pressure on the tailbone and hip bones while sitting. Perfect for sitting on the computer desk for long periods of time.$ Check price
Command Line Kung Fu is packed with dozens of tips and practical real-world examples. You won't find theoretical examples in this book. The examples demonstrate how to solve actual problems. The tactics are easy to find, too. Each chapter covers a specific topic and groups related tips and examples together.$ Check price