Documentfaiz
Documentfaiz
Table of Contents
1 Introduction
3 File Navigation
5 Creating a Directory
8 File Renaming
1 Introduction
What is CMD?
CMD, short for Command Prompt, is a command-line interpreter available in Windows It allows users to
interact with the operating system by typing commands It's a powerful tool for various tasks, including
file handling
File handling is a fundamental aspect of computing Learning to manage files with CMD provides a
deeper understanding of the Windows file system, enhances productivity, and can be valuable for
scripting and automation
Continue reading to delve into the world of CMD and master the art of efficient file handling
- To open CMD, press `Win + R`, type `cmd`, and press Enter
CMD opens in a text-based interface You’ll see a prompt, typically starting with
`C:\Users\YourUsername>` This is where you’ll enter commands You can navigate through directories,
execute commands, and perform file handling tasks here
3 File Navigation
The `cd` (change directory) command allows you to navigate to different directories
The `dir` command lists the files and directories in the current directory
Output Formatting
- File sizes
Recursive Listing
Use `dir /s` to list files and directories in the current directory and its subdirectories
Certainly, let's continue the guide by adding sections on creating, deleting files, and folders in a similar
detailed format as listing files and directories
5 Creating a Directory
To create a directory named "NewFolder" in the current directory, use the following command:
mkdir NewFolder
To delete a file named "File txt" in the current directory, use the following command:
The `rmdir` command is used to remove directories However, it can only delete directories that are
empty
To remove an empty directory named "FolderName" in the current directory, use the following
command:
rmdir FolderName
The `copy` command is used to duplicate files from one location to another
To copy a file named "File txt" to a different location, such as "C:\NewLocation," use the following
command:
The `move` command is used to move files from one location to another It effectively cuts and pastes
the file
To move a file named "File txt" to a different location, such as "C:\NewLocation," use the following
command
These new sections provide detailed information and examples for creating, deleting files, and managing
directories using CMD Continue to the subsequent sections for more commands and in-depth
explanations
8 File Renaming
The `ren` Command
To rename a file named “OldName txt” to “NewName txt” in the current directory, use the following
command:
The `type` command allows you to view the content of text files directly in the CMD window
To view the content of a text file named “File txt,” use the following command:
To create an empty text file named “NewFile txt,” use the following command: