当我有隐藏文件时,比如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
复制相似问题