Saturday, September 13, 2025

Learn MS-DOS (Part 3) - File Operations Commands in MS-DOS

📂 Introduction

In Part 2, we learned how to move around folders and manage directories in MS-DOS. But a computer is not just about folders — it’s about the files inside them. In this part, we’ll cover all the essential file operation commands. These commands let you copy, rename, move, delete, and view files directly from the command line.

Think of these as the tools in your digital toolbox. Just like you cut, paste, and rename files in Windows Explorer today, MS-DOS gives you text-based commands to do the same.


🔹 1. COPY – Copy Files

Purpose: Copies one or more files from one location to another.

Syntax:

COPY [source] [destination]

Examples:

COPY notes.txt D:\Backup

Copies notes.txt into the D:\Backup folder.

COPY *.txt D:\Docs

Copies all .txt files to D:\Docs.

Tip: You can copy multiple files at once using wildcards (* and ?).


🔹 2. XCOPY – Extended Copy

Purpose: More powerful version of COPY, supports copying directories, subdirectories, and multiple files.

Syntax:

XCOPY [source] [destination] [options]

Examples:

XCOPY C:\Reports D:\Backup /S /E
  • /S → copies subdirectories (excluding empty ones)

  • /E → copies everything, including empty directories

XCOPY C:\Docs\*.txt D:\TextFiles

Copies all .txt files from C:\Docs to D:\TextFiles.


🔹 3. DEL or ERASE – Delete Files

Purpose: Deletes one or more files.

Syntax:

DEL [filename] ERASE [filename]

Examples:

DEL notes.txt

Deletes the file notes.txt.

DEL *.tmp

Deletes all files with .tmp extension in the current directory.

⚠ Warning: DOS deletion is permanent — no Recycle Bin!


🔹 4. REN or RENAME – Rename Files

Purpose: Renames a file or group of files.

Syntax:

REN [old filename] [new filename]

Examples:

REN report.txt final.txt

Renames report.txt to final.txt.

REN *.txt *.bak

Renames all .txt files to .bak (changes extensions).


🔹 5. MOVE – Move Files

Purpose: Moves files from one location to another (can also rename files).

Syntax:

MOVE [source] [destination]

Examples:

MOVE notes.txt D:\Docs

Moves notes.txt into D:\Docs.

MOVE old.txt new.txt

Renames old.txt to new.txt.


🔹 6. TYPE – Display File Contents

Purpose: Shows the contents of a text file directly in the console.

Syntax:

TYPE [filename]

Example:

TYPE notes.txt

Displays the content of notes.txt on the screen.


🔹 7. MORE – Paginate File Output

Purpose: Similar to TYPE, but displays text page by page.

Syntax:

MORE < [filename]

Example:

MORE < notes.txt

Shows notes.txt content one page at a time (press spacebar to continue).


🔹 8. PRINT – Send File to Printer

Purpose: Prints a text file directly to the printer.

Syntax:

PRINT [filename]

Example:

PRINT report.txt

Sends report.txt to the default printer.


🧰 Bonus Tips

  • Use wildcards (* and ?) to manage groups of files quickly. Example: COPY *.doc D:\Backup.

  • Be careful with DEL — there’s no undo. Use it with precision.

  • Use MORE instead of TYPE for large files so you don’t lose text scrolling off the screen.


✅ Conclusion

File operation commands are the heart of DOS usage. With these, you can manage your files without ever opening a graphical interface. They may look simple, but they’re incredibly powerful when combined with wildcards and batch scripts.

👉 Up next, in Part 4, we’ll explore System Information Commands — commands that tell you details about your computer like version, memory, date, and time.

No comments:

Post a Comment

Learn Microsoft Word (Part 1) - Introduction to Microsoft Word

🖥 What is Microsoft Word? Microsoft Word is the world’s most popular word processing program . It’s used to create documents such as lette...