Sunday, December 18, 2016

Create soft link in Linux

Suppose you want to create shortcuts in Linux, you can use 'ln -s' command to create soft links.

Ex :- If you need to run JAVA6 and JAVA8 both from terminal, you have to add java6 and java8 commands to /usr/bin for terminal execution.

Steps to keep java6 and java8.

  1. Create two files in /usr/bin/ as java6 and java8
  2. Extract JAVA6 and JAVA8 to Linux file system. Suppose directory locations are /usr/java6/ and /usr/java8/
  3. Create Soft links for java6 and java8 using the following commands as root.

ln -s /usr/java8/jdk1.6.0_10/bin/java /usr/bin/java6

ln -s /usr/java8/jdk1.8.0_12/bin/java /usr/bin/java8

Now check versions using following commands in terminal.

java6 -version
java8 -version

No comments:

Post a Comment