Recent Articles

Taskset For CPU Affinity
SMP operating systems have choices when it comes to scheduling processes: a new or newly rescheduled process can run on any available cpu...

Novell Launches New Data Center Linux Certification Program
Novell is launching the beta version of what it calls the most rigorous training and examination program for Linux certification to meet data center requirements. "CIOs are under increasing pressure to align their IT...

Novell Opens Up SUSE
The technology company announced at LinuxWorld an open version of the SUSE Linux distribution. Following in the footsteps of Sun Microsystems, Novell has made an open distribution of the SUSE Linux...


11.30.05


Symlinks

By A.P. Lawrence

Linux "symlinks" is a handy utility for managing symbolic links. It can clean up the sort of problems that come from carelesness when creating symbolic links.

For purposes of illustration, I created some legal but structurally incorrect symbolic links. With the exeption of the "dangling" sl3 (a dangling symlink points somewhere that does not exist), these all work, but they have problems, and "symlinks -v" will show us:

$ symlinks -v -s . messy: /home/tony/varwwwmess -> /var//www dangling: /home/tony/sl2 -> ../incoming lengthy: /home/tony/sl3 -> ../tony/incoming other_fs: /home/tony/varwww -> /var/www absolute: /home/tony/vhosts -> /home/httpd/vhosts/ relative: /home/tony/webby -> vhosts/webby.com

That's helpful. Even more helpful is that symlinks can clean this stuff up in a flash:

$ symlinks -c -s . messy: /home/tony/varwwwmess -> /var//www changed: /home/tony/varwwwmess -> /var/www dangling: /home/tony/sl2 -> ../incoming lengthy: /home/tony/sl3 -> ../tony/incoming changed: /home/tony/sl3 -> incoming other_fs: /home/tony/varwww -> /var/www absolute: /home/tony/vhosts -> /home/httpd/vhosts/ changed: /home/tony/vhosts -> ../httpd/vhosts $ symlinks -v -s . other_fs: /home/tony/varwwwmess -> /var/www relative: /home/tony/sl3 -> incoming dangling: /home/tony/sl2 -> ../incoming other_fs: /home/tony/varwww -> /var/www relative: /home/tony/vhosts -> ../httpd/vhosts relative: /home/tony/webby -> vhosts/webby.com


>>>Optimize Your Network - Free Bandwidth Monitor Trial


The -c fixes all problems, but does leave the dangling link. To remove it:

$ symlinks -d . other_fs: /home/tony/varwwwmess -> /var/www dangling: /home/tony/sl2 -> ../incoming deleted: /home/tony/sl2 -> ../incoming other_fs: /home/tony/varwww -> /var/www

"symlinks" can operate recursively with "-r" and can show you its actions with "-t".


*Originally published at APLawrence.com
About the Author:
A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

About LinuxDeveloperNews
Get the lastest information on current changes in the Linux Development World.

LinuxDeveloperNews is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxDeveloperNews.com WirelessProNews.com
CProgrammingTrends.com DevWebPro.com


-- LinuxDeveloperNews is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2005 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


LinuxDeveloperNews News Archives About Us Feedback LinuxDeveloperNews Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact