How to do it...

The following steps will help you handle symbolic links:

  1. To create a symbolic link run the following command:
        $ ln -s target symbolic_link_name

 Consider this example:

        $ ln -l -s /var/www/ ~/web

 This creates a symbolic link (called web) in the current user's home directory, which points to /var/www/.

  1. To verify the link was created, run this command:
        $ ls -l ~/web
        lrwxrwxrwx 1 slynux slynux 8 2010-06-25 21:34 web -> /var/www

 web -> /var/www specifies that web points to /var/www.

  1. To print symbolic links in the current directory, use this command:
        $ ls -l | grep "^l"
  1. To print all symbolic links in the current directory and subdirectories, run this command:
        $ find . -type l -print
  1. To display the target path for a given symbolic link, use the readlink command:
        $ readlink web
        /var/www