CmdID

CmdID / Commands

dir

Displays a list of a directory's files and subdirectories. Windows commands reference

On Windows, Linux, Cisco IOS, DOS 1 Sigma rule name it

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0

Displays a list of a directory's files and subdirectories. If used without parameters, this command displays the disk's volume label and serial number, followed by a list of directories and files on the disk (including their names and the date and time each was last modified). For files, this command displays the name extension and the size in bytes. This command also displays the total number of files and directories listed, their cumulative size, and the free space (in bytes) remaining on the disk. The dir command can also run from the Windows Recovery Console, using different parameters. For more information, see Windows Recovery Environment (WinRE).

dir [<drive>:][<path>][<filename>] [...] [/p] [/q] [/w] [/d] [/a[[:]<attributes>]][/o[[:]<sortorder>]] [/t[[:]<timefield>]] [/s] [/b] [/l] [/n] [/x] [/c] [/4] [/r]
C:\test>dir /x
Volume in drive C has no label.
Volume Serial Number is B86A-EF32
Directory of C:\test
11/30/2004 01:40 PM <DIR> .
11/30/2004 01:40 PM <DIR> ..
11/30/2004 11:05 AM 0 T97B4~1.TXT t.txt2
11/30/2004 01:16 PM 0 t97.txt

To display all directories one after the other, in alphabetical order, in wide format, and pausing after each screen, make sure that the root directory is the current directory, and then type

dir /s/w/o/pIdentify

Trips 1 Sigma rule: lowFile And SubFolder Enumeration Via Dir Command by frack113

To alter the preceding example so that dir displays the file names and extensions, but omits the directory names, type

dir /s/w/o/p/a:-dIdentify

Trips 1 Sigma rule: lowFile And SubFolder Enumeration Via Dir Command by frack113

To print a directory listing, type

dir > prnIdentify

Trips 1 Sigma rule: lowCMD Shell Output Redirect by frack113

You can also redirect output of the dir command to a file by replacing prn with a file name. You can also type a path. For example, to direct dir output to the file dir.doc in the Records directory, type

dir > \records\dir.docIdentify

Trips 1 Sigma rule: lowCMD Shell Output Redirect by frack113

If dir.doc does not exist, dir creates it, unless the Records directory does not exist. In that case, the following message appears

File creation errorIdentify

To display a list of all the file names with the .txt extension in all directories on drive C, type

dir c:\*.txt /w/o/s/pIdentify

Trips 1 Sigma rule: lowFile And SubFolder Enumeration Via Dir Command by frack113

Show 18 options
[<drive>:][<path>]Specifies the drive and directory for which you want to see a listing.
[<filename>]Specifies a particular file or group of files for which you want to see a listing.
/pDisplays one screen of the listing at a time. To see the next screen, press any key.
/qDisplays file ownership information.
/wDisplays the listing in wide format, with as many as five file names or directory names on each line.
/dDisplays the listing in the same format as /w, but the files are sorted by column.
/a[[:]<attributes>]Displays only the names of those directories and files with your specified attributes. If you don't use this parameter, the command displays the names of all files except hidden and system files. If you use this parameter without specifying any attributes, the command displays the names of all files, including hidden and system files. The list of possible attributes values are: - d - Directories - h - Hidden files - s - System files - l - Reparse points - r - Read-only files - a - Files ready for archiving - i - Not content indexed filesYou can use any combination of these values, but don't separate your values using spaces. Optionally you can use a colon (:) separator, or you can use a hyphen (-) as a prefix to mean, "not". For example, using the -s attribute won't show the system files.
/o[[:]<sortorder>]Sorts the output according to sortorder, which can be any combination of the following values: - n - Alphabetically by name - e - Alphabetically by extension - g - Group directories first - s - By size, smallest first - d - By date/time, oldest first - Use the - prefix to reverse the sort orderMultiple values are processed in the order in which you list them. Don't separate multiple values with spaces, but you can optionally use a colon (:). If sortorder isn't specified, dir /o lists the directories alphabetically, followed by the files, which are also sorted alphabetically.
/t[[:]<timefield>]Specifies which time field to display or to use for sorting. The available timefield values are: - c - Creation - a - Last accessed - w - Last written
/sLists every occurrence of the specified file name within the specified directory and all subdirectories.
/bDisplays a bare list of directories and files, with no additional information. The /b parameter overrides /w.
/lDisplays unsorted directory names and file names, using lowercase.
/nDisplays a long list format with file names on the far right of the screen.
/xDisplays the short names generated for non-8dot3 file names. The display is the same as the display for /n, but the short name is inserted before the long name.
/cDisplays the thousand separator in file sizes. This is the default behavior. Use /-c to hide separators.
/4Displays years in four-digit format. Because the default dir output can already display four-digit years, you might not notice a change when you use this parameter.
/rDisplay alternate data streams of the file.
/?Displays help at the command prompt.

This command is an alias of ls -C --escape.

Windows

from tldr-pages, CC BY 4.0

List directory contents.

Show the contents of the current directory

Show the contents of a given directory

dir path\to\directoryIdentify

Show the contents of the current directory, including hidden ones

dir /aIdentify
/aDisplays only the names of those directories and files with your specified attributes. Windows commands reference

Show the contents of a given directory, including hidden ones

dir path\to\directory /aIdentify
/aDisplays only the names of those directories and files with your specified attributes. Windows commands reference

Show a bare list of directories and files, with no additional information

dir /bIdentify
/bDisplays a bare list of directories and files, with no additional information. Windows commands reference

Sort results by date/time, oldest first

dir /o:dIdentify
/oSorts the output according to *sortorder*, which can be any combination of the following values: n - Alphabetically by name e - Alphabetically by extension g - Group directories first s - By size, smallest first d - By… Windows commands reference

Cisco IOS

from tldr-pages, CC BY 4.0

List files.

List files in the current working directory

List files in a specific filesystem

dir flash:Identify

List available filesystems

List files and directories.

List current directory

Pause per page

DIR /pIdentify
/pDisplays one screen of the listing at a time. Windows commands reference

List files in wide format

DIR /wIdentify
/wDisplays the listing in wide format, with as many as five file names or directory names on each line. Windows commands reference

What detects it

Sigma process creation rules that name dir