[SLUG] Broken symlinks

Gavin Baker gavbaker at ntlworld.com
Tue Sep 17 19:29:00 BST 2002


On Tue, 2002-09-17 at 12:52, Al Girling wrote:

> I have many files which are shown with white lettering on a red background, 
> when usin 'ls -al' at the command line .  Sometimes the lettering is also 
> flashing.  It has been suggested that a red background is displayed because 
> of a broken symlink.  I'm not sure what this is or how I can fix it.

A symlink (symbolic link) is a type of unix file that refers to another
file by its pathname. You can create them with the ln -s command. (man 1
ln).

(za at martian:za)$ mkdir test; cd test; ls -l
total 0

(za at martian:test)$ touch a-file; ls -l
total 0
-rw-r--r--   1 za   za   0 2002-09-17 19:00 a-file

(za at martian:test)$ ln -s a-file symlink-to-a-file
(za at martian:test)$ ls -l
total 0
-rw-r--r--   1 za   za   0 2002-09-17 19:00 a-file
lrwxrwxrwx   1 za   za   6 2002-09-17 19:01 symlink-to-a-file -> a-file

Any read/write/modify etc you perform on "symlink-to-a-file" is
dereferenced, and performed on the link target (a-file).

If you remove a-file, you are left with a symlink who's target no longer
exists. This is a broken (or dangling, or orphanned) symlink.

> 
> This is the file most frequently to be found with such a background.  It's in 
> my home directory.
> 
> '.DCOPserver_localhost.localdomain -> /home/al/ 
> .DCOPsever_localhost.localdomain_:0'

DCOP is kde's *D*esktop *CO*mmunications *P*rotocol, The DCOP server is
the program that enables simple Interprocess Communication between KDE
applications. That symlink should probably be removed when KDE, or the
KDE applications quit. Is it causing any problems for you, or is the
flashing just giving you an headache? (You can change what a broken
symlink looks like very easily).

Regards,
Gav






More information about the Scarborough mailing list