0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows コマンド チートシート

Posted at

コマンドプロンプト
PowerShell
WSL2(Ubuntu)

Pythonのキャッシュ(pycache)を一括削除

Get-ChildItem -Recurse -Directory -Filter "__pycache__" | Remove-Item -Recurse -Force
for /d /r %i in (__pycache__) do rmdir /s /q "%i"

同一階層のフォルダ名・ファイル名の一覧を取得

dir /b
Get-ChildItem -Name

結果を出力する

Get-ChildItem -Name > result.txt

同階層のファイル名を取得

dir /b /a-d
Get-ChildItem -File -Name

同階層のフォルダ名の一覧を取得

dir /b /ad
Get-ChildItem -Directory -Name

下位のフォルダ名・ファイル名を再帰的に取得

Get-ChildItem -Recurse -Name

結果を出力

Get-ChildItem -Recurse -Name > result.txt

ディレクトリ構成図(ツリー図)

tree /f

文字化け対策、結果を出力

chcp 65001
tree /f > tree.txt

例:".venv|.vscode|.git|data"などは対象外として、最大5階層のツリーを表示

WSL2(ubuntu)を起動し、cdしてから実行

cd /mnt/c/Users/任意のディレクトリ/
tree -a -L 5 -I ".venv|.vscode|.git|data|data_store|__pycache__|eval|scripts"
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?