How can I tell if a file is symbolic link?

How can I tell if a file is symbolic 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