> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Directory (xbdir.exe)

> Directory (xbdir.exe)

Use this tool to show a list of files and subdirectories that are on a remote console.

| Column 1 |
| - |
| \*\*xbdir \*\**filename* \[/A\[ \[:]*attributes*] ] \[/B] \[/C] \[/O\[ \[:]*sortorder*] ] \[/S\[ \[:]*levels*] ] \[/T\[ \[:]*timefield*] ] \[/X\[:]*address\[+\<accesskey>]\[/title]*] |

| Option | Description |
| - | - |
| *filename* | The drive, directory, or files to be listed. A fully qualified path, including the drive letter, must be supplied. Wildcard characters in the file name are supported. The drive letter in *filename* must be prefixed with an X to specify that the drive is on the remote console. |
| /A\[ \[:]*attributes*] | Shows files that have the specified attributes. If no attributes are specified, all files appear. Values are shown as follows. **H** Hidden files **R** Read-only files **S** System files **A** Files that are ready for archiving **-** Negation prefix; shows files that *don't* have the specified flag |
| /B | Uses bare format; only the file names appear. |
| /C | Shows the thousands separator in file sizes. This is the default. To disable showing the separator, use **/-C**. |
| /O\[ \[:]*sortorder*] | Shows files according to a sort order. Values are shown as follows. **D** By date and time, with the oldest first **E** By extension, alphabetical **N** By name, alphabetical **S** By size, with the smallest first **-** Negation prefix for reversing the sort order |
| /S\[ \[:]*levels*] | Shows files that are in a specified directory and all its subdirectories. To specify the subdirectory recursion depth, use *levels* as an optional integer. For example, **xbdir /S:1** processes only the specified directory and subdirectories one level below it. If **/S** is specified but *levels* isn't, all subdirectories are processed. |
| /T\[ \[:]*timefield*] | The time field to be displayed or used to sort. Values are shown as follows. **C** Creation time **A** Last access time **W** Last write time |
| /X\[:]*address\[+\<accesskey>]* | - Use this option to specify the host name or address (shown as **Tools IP** on the console) of a targeted console without changing the default console. For details about setting a host name for a console, see [Setting a host name for the console IP address](/home/setup-install/dev-kit-settings/setting-a-hostname). - If you don't use this option, the default console (previously set by [Connect (xbconnect.exe)](/tools/tools-console/commandlinetools/xbconnect)) is used. - Use the *accesskey* string to provide console access only to those people who have the access key. - Set the access key by using the command **xbconfig** **accesskey=your-key**, and then restart your console to make the access key effective. - To access a console that's configured with an access key, include a plus sign (+) and the access key after the IP address or host name of the console. - If an access key is provided when the default console is set by [xbconnect](/tools/tools-console/commandlinetools/xbconnect), the access key is stored as part of the default console's address. - For more information about access keys, see [xbconfig accesskey](/tools/tools-console/commandlinetools/xbconfig). |
| /LC | Specify the locale code. Used to override the default locale code |

## Remarks

### Target files and directories in the shared scratch-drive partition

The drive-D partition is now accessible as a shared scratch space in the system and from within the Game OS. To list a directory from this shared drive, use **xbdir** (with or without the **/x/title** address) to access the drive partitions and files that are being used by the exclusive resource app. For example, to view all text files in a title's root scratch directory on the console, use one of the following commands.

```
xbdir /X:/title XD:\*.txt  
```

or

```
xbdir XD:\*.txt  
```

If a legacy XBOX One Software Development Kit title is running, drive D is the legacy TitleScratch drive, which isn't the same as drive D in the system but is accessible in the system via the TitleScratch network share when the title isn't running.

### Target files and directories in an app container

While an exclusive app is running, the app container is read-only and mapped to drive G in the `exclusive` partition. For example, to list the files in an application container while an exclusive app is running, use the following command.

```
xbdir /X:/title XG:\ 
```

Apps that are packaged at build time are read-only. Files and directories can be copied for these apps but can't be added, deleted, or modified.

## See also

[Command-line tools](/tools/tools-console/commandlinetools/commandlinetools)

[XTF transport errors](/tools/tools-console/commandlinetools/xtf-transport-errors)

[Connect (xbconnect.exe)](/tools/tools-console/commandlinetools/xbconnect)


## Related topics

- [Connect (xbconnect.exe)](/tools/tools-console/commandlinetools/xbconnect.md)
- [Command-line tools for console development](/tools/tools-console/commandlinetools/commandlinetools.md)
- [Commandlinetools](/tools/tools-console/commandlinetools/index.md)
- [Make directory (xbmkdir.exe)](/tools/tools-console/commandlinetools/xbmkdir.md)
- [Delete directory (xbrmdir.exe)](/tools/tools-console/commandlinetools/xbrmdir.md)
