Dienstag, 30. August 2011

Uploading and Downloading Files and Folders using SCP (Linux)

I happily just discovered that you can do both with the same command..

DOWNLOAD
Situation:
You want to download the file blue.txt which is located in the directory /blue at PC2 with the IP 192.168.1.100 to your root directory.
Command:
scp root@192.168.1.100:/blue/blue.txt /root

UPLOAD
Situation:
You want to send the file blue.txt from your PC to the root folder of another PC with the IP 192.168.1.100
Command:
scp blue.txt root@192.168.100:/root/


*its scp -r ... for directories.

Montag, 1. August 2011

Grep something EXCEPT something (Linux shell)

I dont like my cereal with raisins but i do want milk, oat and all the other stuff in it. So:

cat raisins | grep milk | grep fruit | grep oat | grep -v "raisins"

*Thats right.. Fuck raisins!