Translate

Tuesday 21 November 2023

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.


No comments:

Post a Comment

Note: only a member of this blog may post a comment.