shell
July 25, 2011
Upload file(s) via SSH using SCP
Here’s another useful command line utility – Secure Copy or SCP, that allows you to securely transfer computer files between a local and a remote host.
sudo scp localfile.dmg remoteuser(at)somehost.com://pathtoupload/
Much neater that using an SFTP client no?
Thanks to my work colleague Luke for bringing this to my attention
Top
MarkoMay 23, 2011
Create a JAR file from a list of classes
Just a quick one for my reference.
To create a jar package from a list of Java classes, use the following command in terminal:jar cf jarredfile.jar directory_to_jar
Marko
TopDecember 4, 2010
Excluding directories from ZIP and TAR archive
I’ve been using command line for zipping and ‘tarring’ for a while and never really needed to exclude directories from the archive.
I had to do this today and I worked out that I had to use absolute paths to achieve this.
The following examples will exclude multiple directories from tar and zip archives respectively:tar -cvf documents.tar.gz /home/user/Documents --exclude "/home/user/Documents/exclude1" --exclude "/home/user/Documents/exclude2" zip -vr -9 documents.zip /home/user/Documents -x "/home/user/Documents/exclude1" -x "/home/user/Documents/exclude2"
Marko
Top