Vinay Kumar Singh
विनय कुमार सिंह

MS-DOS / Windows CMD Notes

MS-DOS / विंडोज़ CMD नोट्स

History of DOS DOS का इतिहास

MS-DOS (Microsoft Disk Operating System) was first released in 1981 for IBM-compatible PCs. Microsoft had bought the core code from Seattle Computer Products, where it was known as 86-DOS.

MS-DOS पहली बार 1981 में IBM-compatible PC के लिए आया। इसका मूल कोड Microsoft ने Seattle Computer Products से खरीदा था, जहाँ इसे 86-DOS कहा जाता था।

It was a single-user, single-task, command-line operating system. Its last standalone version, 8.0, came with Windows ME in 2000.

यह एक single-user, single-task और command-line वाला operating system था। इसका आखिरी अलग संस्करण 8.0 था, जो 2000 में Windows ME के साथ आया।

Windows 95 and later versions were built on top of DOS, and the Command Prompt (CMD) you use today is its descendant.

Windows 95 और बाद के Windows DOS के ऊपर ही बने थे, और आज का Command Prompt (CMD) उसी की आगे की पीढ़ी है।

Power and Uses of DOS DOS की ताकत और उपयोग

  1. ★ Simple and fast: commands run quickly with very little memory. सरल और तेज़: बहुत कम मेमोरी में कमांड तुरंत चलते हैं।
  2. ★ File management: create, copy, move, rename and delete files from the keyboard. फ़ाइल प्रबंधन: की-बोर्ड से फ़ाइलें बनाना, कॉपी, मूव, नाम बदलना और हटाना।
  3. ★ Automation: many commands can be saved in a .bat file and run again and again. ऑटोमेशन: कई कमांड .bat फ़ाइल में लिखकर बार-बार चलाए जा सकते हैं।
  4. ★ System administration: used for network checks, disk tasks and system repair. सिस्टम प्रशासन: नेटवर्क जाँच, डिस्क के काम और सिस्टम की मरम्मत के लिए।
  5. ★ Learning: a good base for understanding how files and folders work. सीखना: फ़ाइल और फ़ोल्डर कैसे काम करते हैं, यह समझने की अच्छी बुनियाद।
  6. ★ Old software: some older programs and games still run in DOS or DOS-like environments. पुराने सॉफ़्टवेयर: कुछ पुराने प्रोग्राम और गेम आज भी DOS जैसे वातावरण में चलते हैं।

File and Directory Operations फ़ाइल और डायरेक्टरी संचालन

1. Create a Directory — डायरेक्टरी बनाना

The MD command is used to create a new directory.

MD कमांड से नई डायरेक्टरी (फ़ोल्डर) बनाई जाती है।

Example / उदाहरण:

MD Student

2. Change Directory — डायरेक्टरी बदलना

The CD command is used to enter a directory.

CD कमांड से किसी डायरेक्टरी के अंदर जाया जाता है।

Example / उदाहरण:

CD Student

3. Create a File — फ़ाइल बनाना

The TYPE NUL command is used to create an empty file.

TYPE NUL कमांड से खाली फ़ाइल बनाई जाती है।

Example / उदाहरण:

TYPE NUL > file.txt

4. Write Text into a File — फ़ाइल में टेक्स्ट लिखना

The ECHO command is used to write text into a file.

ECHO कमांड से फ़ाइल के अंदर टेक्स्ट लिखा जाता है।

Example / उदाहरण:

ECHO Hello World > file.txt

5. Read a File — फ़ाइल पढ़ना

The TYPE command is used to display the contents of a file.

TYPE कमांड से फ़ाइल की सामग्री स्क्रीन पर दिखाई जाती है।

Example / उदाहरण:

TYPE file.txt

6. Rename a File — फ़ाइल का नाम बदलना

The REN command is used to change the name of a file.

REN कमांड से फ़ाइल का नाम बदला जाता है।

Example / उदाहरण:

REN file.txt newfile.txt

7. Copy a File — फ़ाइल की कॉपी बनाना

The COPY command is used to create a copy of a file.

COPY कमांड से फ़ाइल की एक प्रति (कॉपी) बनाई जाती है।

Example / उदाहरण:

COPY newfile.txt copy.txt

8. Move a File — फ़ाइल को दूसरी जगह ले जाना

The MOVE command is used to move a file from one directory to another.

MOVE कमांड से फ़ाइल को एक डायरेक्टरी से दूसरी डायरेक्टरी में भेजा जाता है।

Example / उदाहरण:

MOVE copy.txt Backup

9. Delete a File — फ़ाइल हटाना

The DEL command is used to delete a file.

DEL कमांड से फ़ाइल हटाई जाती है।

Example / उदाहरण:

DEL newfile.txt

10. Rename a Directory — डायरेक्टरी का नाम बदलना

The REN command is used to change the name of a directory.

REN कमांड से डायरेक्टरी का नाम भी बदला जाता है।

Example / उदाहरण:

REN Student NewStudent

11. Remove a Directory — डायरेक्टरी हटाना

The RD command is used to remove an empty directory.

RD कमांड से केवल खाली डायरेक्टरी हटाई जाती है।

Example / उदाहरण:

RD NewStudent

12. Display Files and Directories — फ़ाइलें और डायरेक्टरी देखना

The DIR command is used to display the list of files and directories.

DIR कमांड से फ़ाइलों और डायरेक्टरी की सूची दिखती है।

Example / उदाहरण:

DIR

13. Go to the Parent Directory — एक स्तर ऊपर जाना

The CD .. command is used to move one level up.

CD .. कमांड से एक स्तर ऊपर (मूल डायरेक्टरी में) जाया जाता है।

Example / उदाहरण:

CD ..

14. Clear the Screen — स्क्रीन साफ़ करना

The CLS command is used to clear the Command Prompt screen.

CLS कमांड से Command Prompt की स्क्रीन साफ़ की जाती है।

Example / उदाहरण:

CLS

Missing points / छूटी हुई महत्वपूर्ण बातें

  1. ★ > file को नए सिरे से लिखता है (पुरानी सामग्री मिट जाती है)। >> पुरानी सामग्री के बाद जोड़ता है।
  2. ★ ECHO में > से पहले का टेक्स्ट ही फ़ाइल में जाता है।
  3. ★ RD तभी चलता है जब डायरेक्टरी खाली हो। भरी डायरेक्टरी के लिए RD /S का उपयोग होता है, पर इसमें बहुत सावधानी चाहिए।
  4. ★ DEL से हटाई गई फ़ाइलें आमतौर पर Recycle Bin में नहीं जातीं।
  5. ★ नाम में स्पेस हो तो उसे "डबल कोट" में लिखें, जैसे MD "My Folder"।

Practical Exercise व्यावहारिक अभ्यास

नीचे दिए कमांड एक-एक करके क्रम से चलाएँ।

(Corrected sequence: removed the mistake and added verification steps / सुधारा गया क्रम)

  1. 1MD Practice — Practice नाम की डायरेक्टरी बनाएँ।
  2. 2CD Practice — उसके अंदर जाएँ।
  3. 3MD Backup — अंदर Backup डायरेक्टरी बनाएँ।
  4. 4ECHO Hello World > file.txt — file.txt में टेक्स्ट लिखें।
  5. 5TYPE file.txt — फ़ाइल की सामग्री देखें।
  6. 6REN file.txt newfile.txt — फ़ाइल का नाम बदलें।
  7. 7COPY newfile.txt copy.txt — उसकी कॉपी बनाएँ।
  8. 8MOVE copy.txt Backup — copy.txt को Backup में भेजें।
  9. 9DIR — देखें कि Practice में क्या-क्या है।
  10. 10CD Backup DIR CD .. — Backup में जाकर जाँचें कि copy.txt वहाँ है, फिर वापस आएँ।
  11. 11DEL newfile.txt — newfile.txt हटाएँ।
  12. 12CD .. — Practice से बाहर, मूल डायरेक्टरी में आएँ।

Optional cleanup / वैकल्पिक सफ़ाई: DEL Practice\Backup\copy.txt RD Practice\Backup RD Practice

(सफ़ाई के लिए पहले फ़ाइल हटाएँ, फिर खाली डायरेक्टरी हटाएँ। RD भरी डायरेक्टरी पर काम नहीं करता।)

Conclusion निष्कर्ष

MS-DOS and Windows CMD commands are used to create, rename, copy, move, read, and delete files and directories.

MS-DOS और Windows CMD कमांड से फ़ाइलें और डायरेक्टरी बनाई, नाम बदली, कॉपी, मूव, पढ़ी और हटाई जाती हैं।

Note: Be careful when deleting files because deleted files may not be recoverable from the Recycle Bin.

ध्यान दें: फ़ाइल हटाते समय सावधानी रखें, क्योंकि हटाई गई फ़ाइलें Recycle Bin से वापस नहीं मिल सकतीं।

Vinay Kumar Singh
विनय कुमार सिंह
Made by Vinay Kumar Singh
तैयार किया: विनय कुमार सिंह