Monday, 19 December 2016

Dir

  • The dir command allows you to see the available files and directories in the current directory.
  • The dir command also shows the last modification date and time, as well as the file size.

Dir syntax

  • Dir [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4].
  • Help dir using this command see all the commands and with syntax see below image.

Dir examples

Dir *.exe
  • The above command lists any file that ends with the .exe file extension.
Dir *.exe *.txt
  • The above is using multiple filespecs to list any files ending with .exe and .txt in one command.
Dir /on
  • List the files in alphabetical order by the names of the files. But default dir command list in alphabetical order.
Dir /o-n
  • List the files in reverse of alphabetical order by the names of the files.
Dir /ar
  • List only files in the current directory that have the read-only attribute.
Dir /p/w/s
  • This would list all the files and directories in the current directory and the sub directories after that, in wide format and one page at a time.

0 comments:

Post a Comment