我注意到这ls -l
不仅改变了输出的格式,而且还改变了目录符号链接的处理方式:
> ls /rmn
biweekly.sh daily.sh logs ...
> ls -l /rmn
lrwxrwxrwx 1 root root 18 Feb 11 2011 /rmn -> /root/maintenance/
Run Code Online (Sandbox Code Playgroud)
我想获得 中内容的详细列表/rmn
,而不是有关/rmn
符号链接的信息。
我能想到的一种解决方法是创建一个执行以下操作的 shell 函数:
cd /rmn
ls -l
cd -
Run Code Online (Sandbox Code Playgroud)
但这似乎太老套了,尤其是因为它会弄乱cd -
. 有没有更好的办法?
(我使用的是 CentOS 2.6.9)