How do I know if I have hard link or soft link?

Hưng Thịnh

New member
How do I know if I have hard link or soft link?
Answer
You can
check if a file is a symlink with [ -L file ]
. Similarly, you can test if a file is a regular file with [ -f file ] , but in that case, the check is done after resolving symlinks. hardlinks are not a type of file, they are just different names for a file (of any type).
 

Tìm kiếm

Back
Top