如何使用Windows PowerShell显示隐藏文件(dotfiles) [英] How to show hidden files (dotfiles) with windows powershell

查看:510
本文介绍了如何使用Windows PowerShell显示隐藏文件(dotfiles)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我有隐藏文件(例如 dotfiles .git目录)时: 如何在Powershell中列出这些文件和目录?

When I have hidden files, like dotfiles or a .git directory: How can I list those files and directories in Powershell?

Get-ChildItemdirls都没有显示它们.

Neither Get-ChildItem, dir nor ls seem to show them.

推荐答案

为显示此类隐藏文件,请对Get-Childitem命令使用-Force参数.

In order to show such hidden files, use the -Force parameter for the Get-Childitem command.

Get-ChildItem . -Force

您还可以在-Force

dir -Force
ls -Force
gci -Force

也:如果您想完全删除,请删除 .git目录,则可以使用Delete-Item .\.git -Force

Also: if you want to delete fully delete e.g. the .git Directory, you may use Delete-Item .\.git -Force

编辑

根据Get-Help Get-ChildItem -Examples示例3",此方法也适用: dir -att h, !h

According to Get-Help Get-ChildItem -Examples "Example 3" this also works: dir -att h, !h

这篇关于如何使用Windows PowerShell显示隐藏文件(dotfiles)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆