본문 바로가기
소프트웨어

CMD를 활용한 폴더 리스트 및 파일 리스트 추출

by AISTORY777 2023. 8. 13.

# 1:CMD란?

CMD는 Command Prompt의 약자로, Windows 운영 체제에서 명령어를 입력하여 컴퓨터를 제어하는 도구입니다. CMD를 사용하면 폴더 리스트 및 파일 리스트 추출, 파일 및 폴더 생성 및 삭제, 파일 및 폴더 이름 변경, 파일 및 폴더 이동, 파일 및 폴더 복사, 파일 및 폴더 압축 및 해제, 네트워크 연결, 시스템 설정 변경 등 다양한 작업을 수행할 수 있습니다.

 

# 2: 폴더 리스트 추출

폴더 리스트 추출은 특정 폴더에 있는 모든 폴더의 이름을 출력하는 작업입니다. CMD에서 폴더 리스트 추출을 하려면 다음 명령어를 사용합니다.

 

dir /s

이 명령어는 현재 폴더와 하위 폴더에 있는 모든 폴더의 이름을 출력합니다.

 

예를 들어, C:\Users\YourName\Documents 폴더에 있는 모든 폴더의 이름을 출력하려면 다음 명령어를 사용합니다.

 

dir /s C:\Users\YourName\Documents

 

# 3: 파일 리스트 추출

파일 리스트 추출은 특정 폴더에 있는 모든 파일의 이름을 출력하는 작업입니다. CMD에서 파일 리스트 추출을 하려면 다음 명령어를 사용합니다.

 

dir /a-d

 

이 명령어는 현재 폴더에 있는 모든 파일의 이름을 출력합니다.

 

예를 들어, C:\Users\YourName\Documents 폴더에 있는 모든 파일의 이름을 출력하려면 다음 명령어를 사용합니다.

 

dir /a-d C:\Users\YourName\Documents

 

# 4: 폴더 및 파일 생성

폴더 및 파일 생성은 특정 위치에 폴더 또는 파일을 생성하는 작업입니다. CMD에서 폴더 및 파일 생성을 하려면 다음 명령어를 사용합니다.

 

mkdir <folder name>

이 명령어는 <folder name>이라는 이름의 폴더를 생성합니다.

 

copy <file name> <destination>

이 명령어는 <file name>이라는 이름의 파일을 <destination>에 복사합니다.

 

# 5: 폴더 및 파일 삭제

폴더 및 파일 삭제는 특정 위치에 있는 폴더 또는 파일을 삭제하는 작업입니다. CMD에서 폴더 및 파일 삭제를 하려면 다음 명령어를 사용합니다.

 

rmdir <folder name>

이 명령어는 <folder name>이라는 이름의 폴더를 삭제합니다.

 

del <file name>

이 명령어는 <file name>이라는 이름의 파일을 삭제합니다.

 

# 6: 파일 및 폴더 이름 변경

파일 및 폴더 이름 변경은 특정 위치에 있는 파일 또는 폴더의 이름을 변경하는 작업입니다. CMD에서 파일 및 폴더 이름 변경을 하려면 다음 명령어를 사용합니다.

 

ren <old name> <new name>

이 명령어는 <old name>이라는 이름의 파일 또는 폴더의 이름을 <new name>으로 변경합니다.

 

예를 들어, C:\Users\YourName\Documents 폴더에 있는 MyFile.txt 파일의 이름을 MyNewFile.txt로 변경하려면 다음 명령어를 사용합니다.

 

ren C:\Users\YourName\Documents\MyFile.txt MyNewFile.txt

 

이 글에서는 CMD를 활용한 폴더 리스트 및 파일 리스트 추출에 관한 내용을 소개했습니다. CMD는 Windows 운영 체제에서 명령어를 입력하여 컴퓨터를 제어하는 도구로, 다양한 작업을 수행할 수 있습니다.

https://www.danawa.com/

 

스마트한 쇼핑검색, 다나와! : 가격비교 사이트

가격비교 사이트 - 온라인 쇼핑몰, 소셜커머스 전 상품 정보 가격비교 사이트, 비교하면 다나와

www.danawa.com

# What is 1:CMD?

CMD stands for Command Prompt, a tool that controls your computer by typing commands in a Windows operating system. CMD lets you extract folders and file lists, create and delete files and folders, rename files and folders, move files and folders, copy files and folders, compress and release files and folders, connect to networks, and change system settings.

 

# 2: Extract Folder List

Extracting a folder list is an operation that prints the names of all folders in a specific folder. To extract a folder list from CMD, use the following command.

 

dir /s

This command outputs the names of all folders in the current folder and subfolders.

 

For example, to print the names of all folders in the C:\Users\YourName\Documents folder, use the following command.

 

dir /s C:\Users\YourName\Documents

 

# 3: Extract File List

File list extraction is the operation of printing the names of all files in a specific folder. To extract a file list from CMD, use the following command.

 

dir /a-d

This command prints the name of all files in the current folder.

 

For example, to output the names of all files in the C:\Users\YourName\Documents folder, use the following command.

 

dir /a-d C:\Users\YourName\Documents

 

# 4: Creating Folders and Files

Creating folders and files is the task of creating folders or files in a specific location. To create folders and files in CMD, use the following command.

 

mkdir <folder name>

This command creates a folder named <folder name>.

 

copy <file name> <destination>

This command copies a file named <file name> to <destination>.

 

# 5: Delete folders and files

Deleting folders and files is the action of deleting folders or files in a specific location. To delete folders and files from CMD, use the following command.

 

rmdir <folder name>

This command deletes a folder named <folder name>.

 

del <file name>

This command deletes a file named <file name>.

 

# 6: Rename Files and Folders

Renaming files and folders is the action of renaming files or folders in a specific location. To rename files and folders in CMD, use the following command.

 

ren <old name> <new name>

This command changes the name of a file or folder named <old name> to <new name>.

 

For example, to rename the MyFile.txt file in the C:\Users\YourName\Documents folder to MyNewFile.txt, use the following command.

 

ren C:\Users\YourName\Documents\MyFile.txt MyNewFile.txt

 

This article introduced the extraction of folder lists and file lists using CMD. CMD is a tool that controls your computer by typing commands in a Windows operating system, and you can perform various tasks.

 

# 1:CMDとは何ですか?

CMDはCommand Promptの略で、Windowsオペレーティングシステムでコマンドを入力してコンピュータを制御するツールです。 CMDを使用すると、フォルダー リストとファイル リストの抽出、ファイルおよびフォルダーの作成および削除、ファイルおよびフォルダー名の変更、ファイルとフォルダーの移動、ファイルおよびフォルダーのコピー、ファイルおよびフォルダーの圧縮と解除、ネットワーク接続、システム設定の変更などさまざまなタスクを実行できます。

 

# 2:フォルダリストを抽出します

フォルダー リストの抽出は、特定のフォルダーにあるすべてのフォルダーの名前を出力するタスクです。 CMDからフォルダー リストを抽出するには、次のコマンドを使用します。

 

dir /s

このコマンドは、現在フォルダーとサブフォルダーにあるすべてのフォルダーの名前を出力します。

 

たとえば、C:\Users\YourName\Documentsフォルダにあるすべてのフォルダの名前を出力するには、次のコマンドを使用します。

 

dir /s C:\Users\YourName\Documents

 

# 3:ファイルリストを抽出します

ファイル リスト抽出は、特定のフォルダー内のすべてのファイル名を出力するタスクです。 CMDからファイル リストを抽出するには、次のコマンドを使用します。

 

dir /a-d

このコマンドは、現在フォルダーにあるすべてのファイルの名前を出力します。

 

たとえば、C:\Users\YourName\Documentsフォルダにあるすべてのファイルの名前を出力するには、次のコマンドを使用します。

 

dir /a-d C:\Users\YourName\Documents

 

# 4:フォルダとファイルを作成します

フォルダーとファイルの作成は、特定の場所にフォルダーまたはファイルを生成するタスクです。 CMDでフォルダとファイルを作成するには、次のコマンドを使用します。

 

mkdir <folder name>

このコマンドは、<folder name>という名前のフォルダを生成します。

 

copy <file name> <destination>

このコマンドは、<file name>という名前のファイルを<destination>にコピーします。

 

# 5:フォルダとファイルを削除します

フォルダーとファイルの削除は、特定の場所にあるフォルダーまたはファイルを削除するタスクです。 CMDからフォルダーとファイルを削除するには、次のコマンドを使用します。

 

rmdir <folder name>

このコマンドは、<folder name>という名前のフォルダを削除します。

 

del <file name>

このコマンドは、「File name」という名前のファイルを削除します。

 

# 6: ファイルとフォルダーの名前を変更します

ファイルとフォルダー名の変更は、特定の場所にあるファイルまたはフォルダーの名前を変更するタスクです。 CMDでファイルとフォルダ名を変更するには、次のコマンドを使用します。

 

ren <old name> <new name>

このコマンドは、<old name>という名前のファイルまたはフォルダの名前を<new name>に変更します。

 

たとえば、C:\Users\YourName\DocumentsフォルダにあるMyFile.txtファイルの名前をMyNewFile.txtに変更するには、次のコマンドを使用します。

 

ren C:\Users\YourName\Documents\MyFile.txt MyNewFile.txt

 

この記事では、CMDを活用したフォルダリストおよびファイルリスト抽出に関する内容を紹介しました。 CMDはWindowsオペレーティングシステムでコマンドを入力してコンピュータを制御するツールで、さまざまなタスクを実行できます。