Monthly Archives: May 2014

How to copy files between two linux machines?

1. Run terminal on the source server

2. Execute the following command:
scp <source_file> <username>@<destination_server>:<destination_path>
e.x. #scp /home/user/*.txt root@destination.server.com:/home/Joe

Advertisements

How to set JAVA_HOME on Linux

    1. Login to the system
    2. Open a terminal window
    3. Open .bash_profile file for editing
      # vim ~/.bash_profile
    4. Set JAVA_HOME as following: export JAVA_HOME=<path to java>
      export JAVA_HOME=/usr/bin/java
    5. Set PATH as following:
      export PATH=$PATH:/usr/bin/java
    6. Save and close the file. Relogin in order to apply changes
    7. Alternatively use the following to activate new changes:
      # source ~/.bash_profile
      or
      # . ~/.bash_profile

TIP: To find out exact path of java executable use the command as follows:
# which java