hard link vs symbolic link

#####Hard link vs. Soft link in Linux or UNIX

#####Hard links cannot link directories.
Cannot cross file system boundaries.
Soft or symbolic links are just like hard links. It allows to associate multiple filenames with a single file. However, symbolic links allows:

To create links between directories.
Can cross file system boundaries.

#####These links behave differently when the source of the link is moved or removed.

Symbolic links are not updated.
Hard links always refer to the source, even if moved or removed.

#####Link directory
ln -s /mnt/usr/lib/* /usr/lib/
cp -rs /mnt/usr/lib /usr/

Tags:

Add a Comment