2013-07-15 101 views
2

,當我嘗試檢查一個可執行文件的類型,我總是得到這樣的:符號鏈接Linux命令文件

symbolic link to <another_file> 

然後我必須進一步深入研究和運行file <another_file>.有時候這可能需要5或6輪。我想知道是否有辦法讓文件遞歸地轉到原始文件並告訴我文件類型。

+2

如何重命名問題「如何檢查在Linux的符號鏈接的目標文件的類型?」。另一方面,這個問題可能會在這裏最好的問:http://unix.stackexchange.com/ – JonnyRo

回答

1

指定-Lfile應使其符合鏈接。從man page

-L, --dereference 
     option causes symlinks to be followed, as the like-named option 
     in ls(1) (on systems that support symbolic links). This is the 
     default if the environment variable POSIXLY_CORRECT is defined. 
0

使用「文件-L」跟隨符號鏈接