99.9% 的情况下,我并不关心有多少链接指向一个文件。如何让 dired(或者 ls)不显示链接数量?
作为参考,ls -l 的输出类似于:
-rw-rw-rw- 1 root dir 104 Dec 25 19:32 file
在本例中,链接数为 1。据我所知,ls 有一个用于删除组号 (104) 的标志,但没有一个用于删除链接数的标志。
我担心编辑格式会搞砸 dired 的解析,因为 ls 有一个特殊的标志用于生成 dired 的输出。
要控制内容在 dired 中的显示方式,您可以自定义变量dired-listing-switches
。但是,正如您所指出的,不显示链接数量不是一种选择。
稍微不同的方法是使用包dired-details http://www.emacswiki.org/emacs/DiredDetails,它会隐藏所有详细信息,直到您需要为止。这隐藏了链接的数量(但也隐藏了其他信息)。点击链接找到该包(以及dired-details+ http://www.emacswiki.org/emacs/dired-details%2b.el听起来它解决了一些小不便dired-details
).
原答案信息如下:
(setq dired-listing-switches "-l")
来自《进入迪雷德》 http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired-Enter.html信息页面:
变量dired-listing-switches' specifies the
options to give to
ls' 列出
目录;这个字符串must包含-l'. If you use a numeric
prefix argument with the
迪雷德’
命令,您可以指定ls'
switches with the minibuffer before
you enter the directory specification.
No matter how they are specified, the
ls' 开关可以包括短
选项(即单个字符)
不需要参数,而且很长
选项(从--') whose
arguments are specified with
='.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)