How to show hidden files (dotfiles) with windows powershell
61,149
In order to show such hidden files, use the -Force
parameter for the Get-Childitem
command.
Get-ChildItem . -Force
You also can use its aliases, with -Force
dir -Force
ls -Force
gci -Force
Also: if you want to delete fully delete e.g. the .git Directory, you may use Delete-Item .\.git -Force
EDIT
According to Get-Help Get-ChildItem -Examples
"Example 3" this also works:
dir -att h, !h
![fuma](https://i.stack.imgur.com/qvRfc.png?s=256&g=1)
Author by
fuma
Updated on July 30, 2022Comments
-
fuma almost 2 years
When I have hidden files, like dotfiles or a
.git
directory: How can I list those files and directories in Powershell?Neither
Get-ChildItem
,dir
norls
seem to show them. -
Jason S almost 6 years
Get-ChildItem -Attributes Hidden, !Hidden
if you like to type -
Raúl Salinas-Monteagudo almost 5 years"ls -at h " would be the shortest
-
plocks over 4 years-force and -FORCE do work too.
-
ricardoNava about 4 yearsyou can also do
dir -Fo
ls -Fo
gci -Fo
-
Naimul Kabir almost 3 yearsThanks, man. @ricardoNava. This obviously made it much simpler.