Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985