如何隐藏数字链接? [英] How do I hide number of links in dired?

查看:151
本文介绍了如何隐藏数字链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

99.9%的时间里,我不在意多少链接指向一个文件。如何获取可用的(或者,ls)不显示链接数?



为了引用,ls -l的输出是这样的:

 
-rw-rw-rw- 1根目录104 Dec 25 19:32文件

在这种情况下,链接的数量是1. ls有一个标志来删除组号(104),但没有一个可以从我可以告诉的内容中删除链接数。 p>

我很怕编辑格式会打乱dired的解析,因为ls有一个特殊的标志来产生输出到dired。

解决方案

为了控制在dired中显示的内容,您可以自定义变量 dired-listing-switches 。但是,如你所说,不显示链接数不是一个选项。



稍微不同的方法是使用包 dired-details ,它隐藏所有的细节,直到你想要它们。这隐藏了链接的数量(也隐藏了其他信息)。按照链接查找包(和 dired-详细信息+ ,这听起来像是修正了 dired-details 的一些不便之处。



原始答案信息如下:

 (setq dired-listing-switches-l)

Entering Dired信息页:


变量
dired-listing-switches'指定
选项给予
ls'列出
目录;这个字符串必须
包含 -l'。如果您使用数字
前缀参数与
dired'
命令,您可以将$ code> ls'
开关与minibuffer指定为
你输入目录规范。
无论如何指定,
ls'开关可以包括短
选项(即单个字符)
,不需要参数, long
选项(以 - '开头),其
参数用
='指定。



99.9% of the time, I don't care how many links are pointing to a file. How do I get dired (or alternatively, ls) to not display the number of links?

For reference, the output of ls -l is something like:

-rw-rw-rw- 1 root   dir 104 Dec 25 19:32 file

The number of links, in this case, is 1. ls has a flag to remove the group number (104) but not one to remove the number of links, from what I can tell.

I'm afraid editing the format will screw up dired's parsing, as ls has a special flag for producing output to dired.

解决方案

To control how things are displayed in dired, you can customize the variable dired-listing-switches. However, as you noted, not displaying the number of links is not an option.

A slightly different approach would be to use the package dired-details, which hides all details until you want them. This hides the number of links (but also hides other information). Follow the link to find the package (and a dired-details+ which sounds like it fixes a couple minor inconveniences with dired-details).

Original answer information follows:

(setq dired-listing-switches "-l")

From the "Entering Dired" info page:

The variable dired-listing-switches' specifies the options to give tols' for listing the directory; this string must contain -l'. If you use a numeric prefix argument with thedired' command, you can specify the ls' switches with the minibuffer before you enter the directory specification. No matter how they are specified, the ls' switches can include short options (that is, single characters) requiring no arguments, and long options (starting with --') whose arguments are specified with='.

这篇关于如何隐藏数字链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆