Determining if a file is a hard link or symbolic link?
89
votes
7
answers
166232
views
I'm creating a shell script that would take a filename/path to a file and determine if the file is a symbolic link or a hard link.
The only thing is, I don't know how to see if they are a hard link. I created 2 files, one a hard link and one a symbolic link, to use as a test file. But how would I determine if a file is a hard link or symbolic within a shell script?
Also, how would I find the destination partition of a symbolic link? So let's say I have a file that links to a different partition, how would I find the path to that original file?
Asked by k-Rocker
(1465 rep)
Nov 12, 2014, 05:28 PM
Last activity: May 10, 2024, 01:44 PM
Last activity: May 10, 2024, 01:44 PM