dir

To display the contents of a directory, use the dir command.

dir [ filesystem :] [// server /] [ directory ]

Syntax Description

filesystem:
(Optional) Name of the file system. Valid values are bootflash , debug , log , modflash , or volatile .
// server /
(Optional) Name of the server. Valid values are /// , //module-1/ , //sup-1/ , //sup-active/ , or //sup-local/ . The double slash ( // ) is required.
directory
(Optional) Name of a directory. The directory name is case sensitive.

Note There can be no spaces in the filesystem://server/directory string. Individual elements of this string are separated by colons (:) and slashes (/).


Command Default

Displays the contents of the current working directory.

Command Modes

EXEC mode

Command History

Release
Modification
4.0(0)N1(1a)
This command was introduced.

Usage Guidelines

The dir command displays a listing of the files in the specified directory. For each file, it lists the size of the file in bytes, the last modified time of the file, and the filename of the file. This command then displays the usage statistics for the file system.

Use the pwd command to verify the current working directory.

Use the cd command to change the current working directory.

Examples

This example shows how to display the contents of the root directory in bootflash:

switch# dir bootflash:
 

This example shows how to display the contents of the current working directory:

switch# dir
 

Related Commands

Command
Description
cd
Changes the current working directory.
delete
Deletes a file or directory.
pwd
Displays the name of the current working directory.
rmdir
Deletes a directory.