How To Be Mastering Command Prompt #2 DIR

DIR is a command in cmd.exe (command prompt) to display list of files and directory. Files and directory that will display can be hidden and system files/directory. DIR is not only display listout of files and directory but it also can display file/directory with sort order.

Here's the formula for use DIR:

DIR [drive:][path][filename] [/A:[[:]attributes]] [/B] [/C] [/D] [/O[[:]sortedorder]] [/P]


Description:
[drive:][path][namafile], type drivename, path, and filename

/A  for displaying files/directory based on attributes


Attributes:
D --> directory
S --> system files
H --> hidder files
R --> read-only files

/B  display files/directory without header information and summary
/C  show the thousand separators (,) for file size
/D  sort files or directory like column
/O  sort files or directory according to sorted order

sortedorder:
N sort according to filename
S sort according to file size
E sort according to extention
D sort according to date (last created or last modified)
For sample to use DIR
1. Display files / directory in current directory --> DIR


Picture 1. DIR

2. Display log files only  -->  DIR *.log


Picture 2. DIR *.log

3. Display files with specified attributes) -->   DIR /a:h


Picture 3. DIR /a:h

4.Display files with sorted order --> DIR /o:n           


Picture 4. DIR /a:h

Just that, I wish you can do that.
Thank for your visiting. Please type your comments for this tutorial..




No comments:

Post a Comment