1.

How to check whether a link is a hard one or a soft link?

Answer»

We can use -H and -L OPERATORS of the test command to check WHETHER a link is HARD or SOFT (symbolic link).

  • -h file      //true if the file is a symbolic link
  • -L file      //true if the file is a symbolic link

One can also use:

readlink FILE; echo $?       // This returns 1 if it's a hard link and 0 if it's a symbolic link.



Discussion

No Comment Found