1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Powershell では Dir /ah に相当するコマンドをどうするか

Posted at

Dir /ahはXPなどの互換性のために作られているMy Documentを見るために使います
https://qiita.com/Q11Q/items/f8effdbfe4bd06a3ed6f

Powershell で Dir /ahをする方法

Dir /A
/Aが指定された属性のファイルを表示
Hが隠しファイルになる。
しかし「指定された属性のファイルを表示」といっておきながら
D ディレクトリで
Dir /AD
でディレクトリが示される

Powershellではどうするか

管理者モードで

PS C:\users\name>Cd\

と入れてルートをみて、次のいずれかを入力

PS C:\users\name>gci -Directory -Hidden -Force
PS C:\users\name>Dir -Directory -Hidden -Force

Gci、DirはGet-Childitemのエイリアス。エイリアスって別名という意味。
なぜDirがあるかというと、コマンドプロンプト(CMD.EXE)ではDirだったから。
そういう老人のために互換性が設けてあるのです。
上書き保存のアイコンが今はもう誰も使わないフロッピーディスクのようなものですね。

※-Forceはつけてもつけなくても変わらない気も

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?