Linux Format

Hard and symbolic links

-

Links enable you to create an associatio­n between two files or directorie­s. This is useful for maintainin­g multiple versions of a file or directory without the overhead of additional disk space for storing multiple copies. Links can either be hard or symbolic and we can use

ln to create a link between two files.

By default, the ln command will create a hard link between these files. Hard links create an identical copy of the linked file on disk that gets updated automatica­lly as the source file gets updated. While the content of the two files are linked, if the source file gets deleted, the target file will continue to exist as an independen­t file. An important thing to note about hard links is that they only work on the current file system. You can’t create a hard link to a file on a different file system. Also, hard links don’t work for directorie­s. You can however overcome these issues by using the -s switch to create a symbolic link.

Newspapers in English

Newspapers from Australia