此attrib命令说什么?


0

谁能告诉我这个命令说的是什么?当我无法在闪存驱动器上找到文件时,我使用了此命令。但是我不知道它在说什么,我只知道-h-r分别删除了hidden和read属性。

attrib -h -r -s /s /d g:\*.*

Answers:


1

DavidPostill的答案列出了所有attribswitch 的含义。让我们用它来解释该特定命令:

  • -h 删除隐藏的属性(这样项目将显示在资源管理器中)
  • -r 删除只读属性
  • -s 删除系统属性(也使项目显示在资源管理器中)
  • /s 使命令以递归方式查看所有子文件夹
  • /d 使它也将属性应用于文件夹(不仅是文件)
  • g:\*.* 是在其中应用更改的路径

因此,我得出结论,该命令旨在从G驱动器上的所有内容中取消所有属性(*.*表示所有带有扩展名的文件;*是一个匹配一个或多个字符的通配符。这/s使该命令可以处理您起始目录下所有文件夹中的所有内容,g:\

如果您要查找文件,该命令可能会使资源显示在资源管理器中(假设您始终不显示隐藏/系统文件),但是它不会神奇地告诉您所要查找的内容的位置。要查找特定文件,请尝试使用Explorer的搜索功能。


很棒的答案,我非常满意。
tmnlgy

1

该命令是什么意思?

attrib -h -r -s /s /d g:\*.*

运行attrib /?以获取帮助:

F:\test>attrib /?
Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [+I | -I]
       [drive:][path][filename] [/S [/D] [/L]]

  +   Sets an attribute.
  -   Clears an attribute.
  R   Read-only file attribute.
  A   Archive file attribute.
  S   System file attribute.
  H   Hidden file attribute.
  I   Not content indexed file attribute.
  [drive:][path][filename]
      Specifies a file or files for attrib to process.
  /S  Processes matching files in the current folder
      and all subfolders.
  /D  Processes folders as well.
  /L  Work on the attributes of the Symbolic Link versus
      the target of the Symbolic Link

笔记:

  • attrib进一步详细介绍了该attrib命令。

进一步阅读

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.