相対パスにバインドせずにファイルのフルパスを一覧表示する

相対パスにバインドせずにファイルのフルパスを一覧表示する

私はこれを行うことができます

root@server [/home/user/public_html]# ls /home/user/public_html/.htaccess 

しかし、私はこれをしたいです。

ls --switch .htaccess
/home/user/public_html/.htaccess

可能ですか?

ベストアンサー1

findと一緒に使用するのはpwd良い答えですが、2つのサブシェルを作成するので必要ありません。欲しいものを実行するコマンドがあります。

readlink -f .htaccess

出力

$ cd /tmp && touch foo
$ ls ./foo
./foo
$ readlink -f ./foo
/tmp/foo

おすすめ記事