为什么“ dir”命令没有显示某些文件夹?

ben*_*fee 2 powershell cmd dir hidden-files

我使用dirWindows命令提示符中的命令显示目录中的文件/文件夹列表。我注意到它没有显示名为的文件夹tmp。但是,我尝试dir在Powershell中运行,并且确实tmp在输出中显示了该文件夹。为什么Windows命令提示符对我隐藏了该文件夹?

Cof*_*fee 5

您需要在目录中添加“显示隐藏”选项:

dir /a
Run Code Online (Sandbox Code Playgroud)

这应该可以解决问题。

资源

  • @blahshaw @coffee 值得一提的是,Powershell 中的`dir` 是`Get-ChildItem` 的别名。默认情况下,它不显示隐藏文件夹。[`Get-ChildItem -Force`](http://technet.microsoft.com/en-us/library/ee692796.aspx) 会这样做。 (2认同)