Tag Archive: Unix


Copy a directory from localhost to a remote directory on a remote machine:

scp -r mydir username@remotemachine:/home/remotedirectory/

Copy a remote directory from a remote machine to the current directory:

scp -r username@remotemachine:/home/remotedirectory/ .

username is the user on remote host
remotemachine is the remote machine’s name or IP
remote directory is specified after the colon

A subcommand can be exceuted when enclosing it in single backticks (`):
Examples:

mv a `echo b`

List all packages (-qa) containing the name under $PKG and deinstall it (-e option) if only one is returned.

rpm -e `rpm -qa | grep $PKG`
 yum install java 

To export your JDK (i.e. set your environment variable) for applications like Tomcat:

export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/ 

To start Tomcat you need to make the sh-scripts executable, e.g. execute in your tomcat/bin directory

 chmod 774 *.sh