当我有隐藏文件时,比如dotfiles或.git
目录:如何在Powershell中列出这些文件和目录?
Get-ChildItem
、dir
和ls
似乎都没有向他们展示。
发布于 2018-06-12 12:23:04
为了显示这样的隐藏文件,使用-Force
参数作为Get-Childitem
命令。
Get-ChildItem . -Force
您还可以用-Force
使用它的别名。
dir -Force
ls -Force
gci -Force
另外:如果要完全删除(例如.git目录),可以使用Delete-Item .\.git -Force
编辑
根据Get-Help Get-ChildItem -Examples
的“示例3”,这也适用于:dir -att h, !h
https://stackoverflow.com/questions/50817139
复制相似问题