パス上のシンボリックリンクの逆参照

パス上のシンボリックリンクの逆参照

/home/jcubic/www/shell/config.jsonwwwがシンボリックリンクであるファイルへのパスがあります。ここでパスを取得/domains/jcubic.pl/public_htmlできますか?/home/jcubic/domains/jcubic.pl/public_html/shell/config.json/home/jcubic/www/shell/config.json

ベストアンサー1

realpathまたは、readlinkコマンドを使用してシンボリックリンクに従うこともできます。

realpath /home/jcubic/www/shell/config.json
readlink -f /home/jcubic/www/shell/config.json

または、-mリンクが壊れているがまだ結果が必要な場合に使用してください。

おすすめ記事