< Home

dir (user view)

Function

The dir command displays information about files and directories in the storage medium.

Format

dir [ /all ] [ filename | directory | /all-filesystems ]

Parameters

Parameter

Description

Value

/all

Displays information about all files and directories in the current directory, including files and directories moved to the recycle bin from the current directory.

-

filename

Specifies the file name.

The value is a string of 1 to 160 case-insensitive characters without spaces in the format [ drive ] [ path ] filename. If the string is enclosed in double quotation marks (" "), the string can contain spaces. If the value is a file name, the value is a string of 1 to 64 characters.

In the preceding parameter, drive specifies the storage device name, and path specifies the directory and subdirectory.

You are advised to add : and / between the storage device name and directory. The directory name cannot contain the following characters: ~ * / \ : ' "

directory

Specifies the file directory.

The value is a string of 1 to 64 case-insensitive characters without spaces in the [ drive ] path format.

In the preceding parameter, drive specifies the storage device name, and path specifies the directory and subdirectory.

You are advised to add : and / between the storage device name and directory. The directory name cannot contain the following characters: ~ * / \ : ' "

/all-filesystems

Display information about files and directories in the root directories of all the storage media on the device.

-

Views

User view

Default Level

3: Management level

Usage Guidelines

The wildcard character (*) can be used in this command. If no parameter is specified, this command displays information about files and directories in the current directory.

The following describes the drive name:

  • drive is the storage device and is named as flash:.

  • If devices are stacked, drive can be named as:

    • flash: root directory of the flash memory of the master switch in the stack.
    • chassis ID#flash: root directory of the flash memory on a device in the stack.

    For example, slot2#flash: indicates the flash memory in slot 2.

The path can be an absolute path or relative path. A relative path can be designated relative to either the root directory or the current working directory. A relative path beginning with a slash (/) is a path relative to the root directory.
  • flash:/my/test/ is an absolute path.

  • /selftest/ is a path relative to the root directory and indicates the selftest directory in the root directory.

  • selftest/ is a path relative to the current working directory and indicates the selftest directory in the current working directory.

You can run the dir /all command to view information about all files and directories of the storage medium, including those moved to the recycle bin. The name of a file in the recycle bin is placed in square brackets ([]), for example, [test.txt].

Example

# Display information about all files and directories in the current directory.

<HUAWEI> dir /all
Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time       FileName
    0  -rw-            889  Feb 25 2012 10:00:58   private-data.txt
    1  -rw-          6,311  Feb 17 2012 14:05:04   backup.cfg
    2  -rw-            836  Jan 01 2012 18:06:20   rr.dat
    3  drw-              -  Jan 01 2012 18:08:20   logfile
    4  -rw-            836  Jan 01 2012 18:06:20   rr.bak
    5  drw-              -  Feb 27 2012 00:00:54   security
    6  -rw-        523,240  Mar 16 2011 11:21:36   bootrom_53hib66.bin
    7  -rw-          2,290  Feb 25 2012 16:46:06   vrpcfg.cfg
    8  -rw-            812  Dec 12 2011 15:43:10   hostkey
    9  drw-              -  Jan 01 2012 18:05:48   compatible
   10  -rw-     25,841,428  Nov 17 2011 09:48:10   basicsoft.cc
   11  -rw-            540  Dec 12 2011 15:43:12   serverkey
   12  -rw-     26,101,692  Dec 21 2011 11:44:52   devicesoft.cc
   13  -rw-          6,292  Feb 14 2012 11:14:32   1.cfg
   14  -rw-          6,311  Feb 17 2012 10:22:56   1234.cfg
   15  -rw-          6,311  Feb 25 2012 17:22:30   [11.cfg]

65,233 KB total (13,632 KB free)
                                

# Display information about files and directories in the root directories of all the storage media on the devices in a stack.

<HUAWEI> dir /all-filesystems
Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time       FileName
    0  -rw-         10,872  Nov 22 2012 20:26:28   private-data.txt
    1  -rw-            836  Nov 22 2012 20:26:44   rr.dat
    2  -rw-            836  Nov 22 2012 20:26:44   rr.bak
    3  -rw-          1,640  Nov 22 2012 20:24:50   vrpcfg.zip
    4  -rw-             10  Jun 05 2012 09:58:50   dhcp-duid
    5  -rw-        216,399  Nov 22 2012 20:16:52   patch_all_pack.pat
    6  drw-              -  Nov 22 2012 20:06:58   dhcp
    7  drw-              -  Nov 22 2012 20:26:32   compatible
    8  drw-              -  Nov 22 2012 20:28:46   logfile
    9  -rw-          1,399  Oct 25 2012 16:32:12   vrpcfg11.zip
   10  drw-              -  Sep 26 2009 11:02:52   user
   11  -rw-     15,298,556  Nov 20 2012 03:21:16   basicsoft.cc
   12  -rw-        289,596  Nov 16 2012 14:58:00   patch.pat

65,233 KB total (33,632 KB free)

Directory of slot1#flash:/

  Idx  Attr     Size(Byte)  Date        Time       FileName
    0  -rw-         10,872  Nov 22 2012 20:28:24   private-data.txt
    1  -rw-            836  Nov 22 2012 20:27:48   rr.dat
    2  -rw-            836  Nov 22 2012 20:27:48   rr.bak
    3  -rw-          1,640  Nov 22 2012 20:24:52   vrpcfg.zip
    4  -rw-             10  Oct 10 2008 22:58:40   dhcp-duid
    5  -rw-        216,399  Nov 22 2012 14:34:36   patch_all_pack.pat
    6  drw-              -  Nov 22 2012 20:28:22   dhcp
    7  drw-              -  Nov 22 2012 20:27:16   compatible
    8  drw-              -  Oct 10 2008 23:00:40   logfile
    9  drw-              -  Nov 24 2012 00:00:18   resetinfo
   10  drw-              -  Sep 26 2009 11:03:02   user
   11  -rw-     15,298,556  Nov 21 2012 14:39:54   basicsoft.cc

65,233 KB total (33,632 KB free)

# Display information about the file vrpcfg.cfg in the current directory.

<HUAWEI> dir vrpcfg.cfg
Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time       FileName
    0  -rw-          2,290  Feb 25 2012 16:46:06   vrpcfg.cfg

65,233 KB total (13,632 KB free)

# Display information about all .txt files in the current directory.

<HUAWEI> dir *.txt
Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time       FileName
    0  -rw-            889  Feb 25 2012 10:00:58   private-data.txt

65,233 KB total (13,632 KB free)
Table 1 Description of the dir command output

Item

Description

d

Directory. If this item is not displayed, the corresponding FileName field displays a file. For example, devicesoft.cc is a file and security is a directory.

r

The file or directory is readable.

w

The file or directory is writable.

[ ]

A file moved to the recycle bin.

FileName

  • private-data.txt: The file saves service initialization data. Initialization data of some tasks is irrelevant to the configuration and is not recorded in the configuration file. The private-data.txt file records initialization data of these tasks, for example, the number of times the device restarts.
  • vrpcfg.cfg: configuration file. The file name extension of the configuration file must be .cfg or .zip.
  • basicsoft.cc: system software. The file name extension of the system software must be .cc.
  • logfile: log file.

Some software sub-systems store necessary data in other files in the file system when the device is running properly.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >