0
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 1 year has passed since last update.

cmdでフォルダ構成を調べる。(dirコマンド)

Last updated at Posted at 2019-02-28

dirコマンドでフォルダ構成を調べる。(windows)
(1)ファイルとフォルダの一覧を取得
(2)フォルダの一覧を取得
(3)ファイルの一覧を取得
上記の3つのパターンを記載しています。

(1)ファイルとフォルダの一覧を取得

コマンド(windows)
dir /s /b c:¥〜¥Work > c:¥F1.txt
出力結果:F1.txt
c:¥〜¥Work¥仕事
c:¥〜¥Work¥仕事¥スケジュール.xlsx
c:¥〜¥Work¥仕事¥メモ.txt
c:¥〜¥Work¥目標¥ダイエット.xlsx
c:¥〜¥Work¥目標¥運動とは.txt
c:¥〜¥Work¥目標¥タスク
c:¥〜¥Work¥目標¥タスク¥やること一覧.xlsx
c:¥〜¥Work¥その他
c:¥〜¥Work¥その他¥新元号予想一覧.xlsx
c:¥〜¥Work¥その他¥旅行計画.pdf

(2)フォルダの一覧を取得

コマンド(windows)
dir /a:d /s /b c:¥〜¥Work > c:¥F2.txt
出力結果:F2.txt
c:¥〜¥Work¥仕事
c:¥〜¥Work¥目標¥タスク
c:¥〜¥Work¥その他

(3)ファイルの一覧を取得

コマンド(windows)
dir /a-d /s /b c:¥〜¥Work > c:¥F3.txt
出力結果:F3.txt
c:¥〜¥Work¥仕事¥スケジュール.xlsx
c:¥〜¥Work¥仕事¥メモ.txt
c:¥〜¥Work¥目標¥ダイエット.xlsx
c:¥〜¥Work¥目標¥運動とは.txt
c:¥〜¥Work¥目標¥タスク¥やること一覧.xlsx
c:¥〜¥Work¥その他¥新元号予想一覧.xlsx
c:¥〜¥Work¥その他¥旅行計画.pdf

補足
c:¥〜¥Workは、任意のディレクトリ。
dir /?をするとオプションが調べられます。

0
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
0
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?