为什么 `getfattr -d` 没有显示任何内容?

blo*_*oys 5 linux ntfs xattr

我开始的成功命令:

getfattr -n system.ntfs_times /media/hdd/oldfolder/

输出

getfattr: Removing leading '/' from absolute path names
# file: media/hdd/oldfolder/
system.ntfs_times=irrelevant
Run Code Online (Sandbox Code Playgroud)

但如果我尝试

getfattr -d /media/hdd/oldfolder/getfattr -d -e text /media/hdd/oldfolder/hexbase64作为参数的值-e我什么也得不到。

这是为什么?我认为-d转储所有属性而不是没有属性:)

Gan*_*ton 6

要真正报告所有属性,您可以使用参数-dm-,它代表参数-d-m -

例如,我启动了 Chromium,访问https://bugsfiles.kde.org/attachment.cgi?id=86198,该操作开始下载文件,并将其命名为“my_downloaded_file”。

然后我执行getfattr -m- my_downloaded_file并显示:

# file: my_downloaded_file
user.xdg.origin.url
Run Code Online (Sandbox Code Playgroud)

尽管显示更多信息正在执行getfattr -dm- my_downloaded_file

# file: my_downloaded_file
user.xdg.origin.url="https://bugsfiles.kde.org/attachment.cgi?id=86198"
Run Code Online (Sandbox Code Playgroud)

参考:


小智 1

getfattr 命令的手册页对此并不清楚,但要真正查看所有输出,请使用以下开关:

getfattr -m - -- "$your_path_or_file_name"
Run Code Online (Sandbox Code Playgroud)

从手册页:

-m pattern, --match=pattern
           Only include attributes with names matching the regular expression pattern.  The default value for pattern
           is "^user\\.", which includes all the attributes in the user namespace.  Specify  "-"  for  including  all
           attributes.  Refer to attr(5) for a more detailed discussion of namespaces.
Run Code Online (Sandbox Code Playgroud)