rm secondlink

Deletes the other link. When there are no more links to a file, Linux deletes the file itself, that is, its inode.

All files work like this—even special types of files such as devices (e.g. /dev/hda).

A directory is simply a list of filenames and inode numbers, that is, a list of hard links. When you create a hard link, you’re just adding a name-number pair to a directory. When you delete a file, you’re just removing a hard link from a directory.

13.2.2 Types of Files

One detail we’ve been concealing up to now is that the Linux kernel considers nearly everything to be a file. That includes directories and devices: They’re just special kinds of files.

As you may remember, the first character of an ls -l display represents the type of the file. For an ordinary file, this will be simply -. Other possibilities include the following:

ddirectory
lsymbolic link
bblock device
ccharacter device
pnamed pipe
ssocket

Symbolic Links

Symbolic links (also called “symlinks” or “soft links”) are the other kind of link besides hard links. A symlink is a special file that “points to” a hard link on any mounted filesystem. When you try to read the contents of a symlink, it gives the contents of the file it’s pointing to rather than the contents of the symlink itself. Because directories, devices, and other symlinks are types of files, you can point a symlink at any of those things.