Translate

Tuesday 21 November 2023

changing directory,cd..,cd/,change drive,cls,exit commands in ms dos

 


Here are some common MS-DOS commands and their uses:

Changing Directories

  • cd <directory>: Changes the current directory to the specified directory. For example, cd Documents would change the current directory to the "Documents" folder.

  • cd..: Moves one level up in the directory tree. For example, if you are currently in the "My Documents" folder, typing cd.. would move you to the parent folder, which is typically your user directory.

  • cd\: Returns to the root directory of the current drive.

Changing Drives

  • <drive>: Switches to the specified drive. For example, C: would switch to the C drive, and D: would switch to the D drive.

Clearing the Screen

  • cls: Clears the contents of the Command Prompt window.

Exiting the Command Prompt

  • exit: Closes the Command Prompt window.

These are just a few of the many MS-DOS commands available. For a complete list of commands and their options, type help in the Command Prompt window.

Additional Helpful Commands

  • dir: Displays the contents of the current directory.

  • copy: Copies files or directories.

  • move: Moves files or directories.

  • del: Deletes files or directories.

  • ren: Renames files or directories.

  • format: Formats a disk or removable drive.

  • chkdsk: Checks the disk for errors and repairs any that are found.

  • fdisk: Partitions a disk or removable drive.

  • sys: Copies the MS-DOS system files to a disk or removable drive.

  • scannow: Scans the system for errors and repairs any that are found.

I hope this helps!


list the all dir command options with examples

 


Here's a comprehensive list of dir command options along with their descriptions:

  1. /a: Sorts the output by attributes, including name, extension, size, date, and time. You can specify the sorting order by following the /a option with a letter:

  • a: Sorts by name in ascending order.

  • d: Sorts by date in descending order.

  • n: Sorts by name in descending order.

  • s: Sorts by size in ascending order.

  • t: Sorts by time in descending order.

  1. /b: Displays a bare list of filenames without any headers or summary information.

  2. /c: Displays the compression ratio of files compressed using DBLSPACE. This option is available with DOS Version 6.

  3. /d: Displays the files and folders in four-column format, similar to the directory view in File Explorer.

  4. /e: Sorts the output by extension.

  5. /l: Displays the full path of each file or folder.

  6. /n: Displays the owner of each file or folder.

  7. /o: Sorts the output by various columns, such as name, extension, size, date, and time. You can specify the sorting order by following the /o option with a letter:

  • n: Sorts by name.

  • e: Sorts by extension.

  • s: Sorts by size.

  • d: Sorts by date.

  • t: Sorts by time.

  1. /p: Pauses the output when the screen is full. Press any key to continue to the next page.

  2. /q: Displays the file attributes of each file or folder.

  3. /r: Displays alternate data streams.

  4. /s: Recursively lists the contents of the current directory and all subdirectories.

  5. /t: Sorts the output by various timestamps, such as creation, last access, and last modification. You can specify the sorting order by following the /t option with a letter:

  • c: Sorts by creation time.

  • a: Sorts by last access time.

  • m: Sorts by last modification time.

  1. /w: Displays the files and folders in wide format, similar to the directory view in File Explorer.

  2. /x: Displays the short filenames for files with long filenames.

Note that these options are case-insensitive. You can combine these options to achieve more specific results. For instance, to list all files with the ".txt" extension and their full paths, use dir *.txt /n.

To explore the full range of options and their usage, type dir /? in the Command Prompt. This will display the detailed help information for the dir command, providing extensive guidance on its various functionalities.


How to Clear Command Prompt Screen Windows and how to close cmd

 How to Clear Command Prompt Screen Windows and how to close cmd


To clear the Command Prompt screen in Windows, you can use the cls command. This will clear all of the text from the screen, including any previous commands and their output.


To close the Command Prompt, you can click the X button in the top right corner of the window. You can also right-click on the Command Prompt icon in the taskbar and select Close Window.


Alternatively, you can type the exit command into the Command Prompt and press Enter. This will also close the window.


Here are some examples of how to clear and close the Command Prompt:

  • To clear the screen using the cls command:


cls

  • To close the window using the X button:

  • To close the window using the right-click context menu:

  • To close the window using the exit command:


exit

How to Clear Command Prompt Screen Windows and how to close cmd

 How to Clear Command Prompt Screen Windows and how to close cmd


To clear the Command Prompt screen in Windows, you can use the cls command. This will clear all of the text from the screen, including any previous commands and their output.


To close the Command Prompt, you can click the X button in the top right corner of the window. You can also right-click on the Command Prompt icon in the taskbar and select Close Window.


Alternatively, you can type the exit command into the Command Prompt and press Enter. This will also close the window.


Here are some examples of how to clear and close the Command Prompt:

  • To clear the screen using the cls command:


cls

  • To close the window using the X button:

  • To close the window using the right-click context menu:

  • To close the window using the exit command:


exit