01-Fundamentals Command Reference

HomeSupportResource CenterRoutersCR19000 Core SeriesCR19000 Core SeriesTechnical DocumentsReference GuidesCommand ReferencesH3C CR19000 Core Router Series Command References-E3521-5W10001-Fundamentals Command Reference
09-Emergency shell commands
Title Size Download
09-Emergency shell commands 80.65 KB

Emergency shell commands

File system names, directory names, or file names must be compliant with the naming conventions. For more information about the naming conventions and the methods for specifying the names, see Fundamentals Configuration Guide.

Unless otherwise stated, a file or directory name argument in this document must contain the file system name and cannot contain file system location information. The path information can contain multiple levels of directories, each of which can have 1 to 255 characters. The file name alone (without the path information) can have 1 to 255 characters. The entire argument can have 1 to 511 characters.

copy

Use copy to copy a file.

Syntax

copy source-file { dest-file | dest-directory }

Views

User view

Parameters

source-file: Specifies the file to be copied.

dest-file: Specifies the destination file.

dest-directory: Specifies the destination directory. The system uses the name of the source file as the name for the destination file.

Usage guidelines

If the destination file already exists, the system prompts whether or not to overwrite it. If you enter Y, the existing file is overwritten. If you enter N, the command is not executed.

Examples

# Copy the test.cfg file. Save the copy to testbackup.cfg.

<boot> copy flash:/test.cfg flash:/testbackup.cfg

Copy flash:/test.cfg to flash:/testbackup.cfg?[Y/N]:y

Start to copy flash:/test.cfg to flash:/testbackup.cfg...Done.

# Copy the test.cfg file and save the copy to testbackup.cfg. Overwrite the existing file that has the same name as the destination file.

<boot> copy flash:/test.cfg flash:/testbackup.cfg

Copy flash:/test.cfg to flash:/testbackup.cfg?[Y/N]:y

flash:/testbackup.cfg already exists. Overwrite it?[Y/N]:y

Start to copy flash:/test.cfg to flash:/testbackup.cfg...Done.

delete

Use delete to permanently delete a file.

Syntax

delete file

Views

User view

Parameters

file: Specifies the file to be deleted.

Examples

# Delete the tt.cfg file.

<boot> delete flash:/tt.cfg

Delete flash:/tt.cfg? [Y/N]:y

Deleting the file permanently will take a long time. Please wait...

Start to delete flash:/tt.cfg...Done.

dir

Use dir to display files or directories.

Syntax

dir [ /all ] [ file | directory ]

Views

User view

Parameters

/all: Displays both hidden and non-hidden files and subdirectories.

file: Specifies a file.

directory: Specifies a directory.

Usage guidelines

Task

Command

Remarks

Display all non-hidden files and subdirectories in the current directory.

dir

N/A

Display all files and subdirectories in the current directory.

dir /all

N/A

Display all non-hidden files and subdirectories in a directory.

dir directory

Specify a directory for the directory argument.

Display all files and subdirectories in a directory.

dir /all directory

Specify a directory for the directory argument.

Display a file.

dir file

Specify a file for the file argument.

Examples

# Display information about all files and directories in the system.

<boot> dir /all

Directory of flash:

     0      drw-           -  Jan 01 2012 00:06:09     01

     1      drw-           -  Sep 15 2012 04:03:14     pki

     2      drw-           -  Jan 01 2012 00:04:07     test

     3      drw-           -  Nov 05 2012 06:45:07     logfile

     4      -rwh          20  Oct 20 2012 09:09:52     .snmpboots

     5      drw-           -  Nov 05 2012 05:56:22     diagfile

     6      drwh           -  Aug 20 2012 09:23:48     .trash

     7      -rw-         816  Aug 20 2012 06:15:00     ifindex.dat

     8      -rw-        3231  Aug 31 2012 09:01:41     startup.cfg

     9      -rw-       60620  Aug 31 2012 09:01:43     startup.mdb

    10      drw-           -  Sep 30 2012 04:43:24     versionInfo

    11      drw-           -  Nov 05 2012 05:56:22     seclog

    12      -rwh          18  Aug 20 2012 09:09:34     .pathfile

    13      -rw-    11238400  Aug 30 2012 11:06:53     boot-t2301001.bin

    14      -rw-           0  Aug 31 2012 05:04:40     lauth.dat

    15      -rw-        4383  Oct 20 2012 06:15:00     test.cfg

 

61440 KB total (11108 KB free)

# Display all unhidden files and directories in the system.

<boot> dir

Directory of flash:

     0      drw-           -  Jan 01 2012 00:06:09     01

     1      drw-           -  Sep 15 2012 04:03:14     pki

     2      drw-           -  Jan 01 2012 00:04:07     test

     3      drw-           -  Nov 05 2012 06:45:07     logfile

     4      drw-           -  Nov 05 2012 05:56:22     diagfile

     5      -rw-         816  Aug 20 2012 06:15:00     ifindex.dat

     6      -rw-        3231  Aug 31 2012 09:01:41     startup.cfg

     7      -rw-       60620  Aug 31 2012 09:01:43     startup.mdb

     8      drw-           -  Sep 30 2012 04:43:24     versionInfo

     9      drw-           -  Nov 05 2012 05:56:22     seclog

    10      -rw-    11238400  Aug 30 2012 11:06:53     boot-t2301001.bin

    11      -rw-           0  Aug 31 2012 05:04:40     lauth.dat

    12      -rw-        4383  Aug 20 2012 06:15:00     test.cfg

 

61440 KB total (11108 KB free)

# Display information about the config.cfg file.

<boot> dir flash:/config.cfg

Directory of flash:

     0      -rw-        3231  Aug 31 2012 09:01:41     startup.cfg

 

61440 KB total (11108 KB free)

Table 1 Command output

Field

Description

Directory of

Current directory.

7      -rw-        3231  Aug 31 2012 09:01:41     startup.cfg

Information about a file or directory:

·     7—Index number, automatically assigned by the system.

·     -rw-—Attributes of the file or directory. The first character is the directory indicator (d for directory and - for file). The second character indicates whether the file or directory is readable (r for readable). The third character indicates whether the file or directory is writable (w for writable). The last character indicates whether the file or directory is hidden (h for hidden and - for visible).

·     3231—Size of the file, in bytes. For a directory, the value of this field is a hyphen (-).

·     Aug 31 2012 09:01:41—Time when the file was most recently modified.

·     startup.cfg—Name of the file or directory.

61440 KB total (11108 KB free)

Total size of the storage medium and size of the free space, in kilobytes.

display copyright

Use display copyright to display copyright information.

Syntax

display copyright

Views

Any view

Examples

# Display copyright information.

<boot> display copyright

...

display install package

Use display install package to display information about a software package.

Syntax

display install package package

Views

Any view

Parameters

package: Specifies a .bin system image file in the filesystemname/filename.bin format, for example, flash:/startup-system.bin. The file must be saved in the root directory of a file system on the current MPU. The value string can have a maximum of 63 characters. The filesystemname cannot contain file system location information.

Examples

# Display information about the system.bin software package.

<boot> display install package flash:/system.bin

  flash:/system.bin

  [Package]

  Vendor: H3C

  Product: CR19000

  Service name: system

  Platform version: 7.075

  Product version: Alpha 13012002

  Supported board: mpu 1pu

  Version type: debu

  [Component]

  Component: system

  Description: system package

Table 2 Command output

Field

Description

Product

Product name.

Service name

Type of the service package:

·     boot—Boot image.

·     system—System image.

·     patch—Patch package.

If the value of this field is not boot, system, or patch, the service packet is a feature package.

Platform version

Platform version number.

Product version

Product version number. You determine whether the version of a system image matches that of a boot image by checking the value of this field.

Supported board

Types of cards that the software package supports:

·     mpu—MPU.

·     lpu—Service card.

·     sfc—Switching fabric card.

[Component]

Information about the components of the software package.

display version

Use display version to display boot image version information.

Syntax

display version

Views

Any view

Examples

# Display boot image version information.

<boot> display version

format

Use format to format a file system.

Syntax

format filesystem

Views

User view

Parameters

filesystem: Specifies a file system.

Usage guidelines

Use this command with caution. This command permanently deletes all files and directories from the file system, including the startup image files and startup configuration files. The deleted files and directories cannot be restored. Without startup images, the device cannot reboot.

Examples

# Format the flash: file system.

<boot> format flash:

All data on flash: will be lost, continue?[Y/N]:y

Formatting flash:… Done.

install load

Use install load to load a system image and start the Comware system.

Syntax

install load system-package

Views

User view

Parameters

system-package: Specifies a .bin system image file in the filesystemname/filename.bin format, for example, flash:/startup-system.bin. The file must be saved in the root directory of a file system on the current MPU or the current member device. The value string can have a maximum of 63 characters. The filesystemname cannot contain file system location information.

Usage guidelines

This command modifies the main startup image list to include only the boot image and system image. The modification ensures that the device can reboot correctly.

After the Comware system starts up, you can load feature and patch images. For more information, see the chapters about software upgrade and ISSU in Fundamentals Configuration Guide.

Examples

# Load a system image and start the Comware system.

<boot> install load flash:/system.bin

Check package flash:/system.bin ...

Verifying the file flash:/system.bin ........Done.

Extracting package ...

 

Loading...

Cryptographic algorithms tests passed.

Line con1 is available.

 

 

Press ENTER to get started.

mkdir

Use mkdir to create a directory.

Syntax

mkdir directory

Views

User view

Parameters

directory: Specifies a directory.

Usage guidelines

You can create a directory only in an existing directory. For example, to create the flash:/test/mytest directory, the directory test must already exist.

The name of the directory to be created must be unique in the parent directory.

Examples

# Create a directory named test.

<boot> mkdir flash:/test

Directory flash:/test created.

# Create a directory named subtest in the flash:/test directory.

<boot> mkdir flash:/test/subtest

Directory flash:/test/subtest created.

Related commands

dir

rmdir

more

Use more to display the contents of a text file.

Syntax

more file

Views

User view

Parameters

file: Specifies a text file.

Examples

# Display the contents of the test.txt file.

<boot> more flash:/test.txt

Have a nice day.

move

Use move to move a file.

Syntax

move source-file { dest-file | dest-directory }

Views

User view

Parameters

source-file: Specifies the name of the file to be moved, a case-insensitive string of 1 to 63 characters.

dest-file: Specifies the name for the destination file, a case-insensitive string of 1 to 63 characters.

dest-directory: Specifies the name of the directory, a case-insensitive string of 1 to 63 characters. The system moves the file without changing the file name.

Usage guidelines

If a file in the destination directory is using the destination file name, the system prompts whether or not to overwrite the existing file. If you enter Y, the existing file is overwritten. If you enter N, the command is not executed.

Examples

# Move the config.cfg file to the flash:/test directory.

<boot>move flash:/config.cfg flash:/test/

Move flash:/config.cfg to flash:/test/config.cfg?[Y/N]:y

<boot> dir flash:/test

Directory of flash:/test

     0      -rw-       77065  Oct 20 1939 06:15:02     config.cfg

 

61440 KB total (11108 KB free)

pwd

Use pwd to display the working directory.

Syntax

pwd

Views

User view

Examples

# Display the working directory.

<boot> pwd

flash:

quit

Use quit to return to the upper-level view.

Syntax

quit

Views

System view

Examples

# Return from system view to user view.

[boot] quit

<boot>

reboot

Use reboot to reboot the current MPU.

Syntax

reboot

Views

User view

Examples

# Reboot the current MPU.

<boot> reboot

rmdir

Use rmdir to delete an existing directory.

Syntax

rmdir directory

Views

User view

Parameters

directory: Specifies the directory to be deleted.

Usage guidelines

To delete a directory, first delete the files and subdirectories in the directory. To delete files, use the delete command.

Examples

# Delete the mydir directory.

<boot> rmdir flash:/mydir

Remove directory flash:/mydir?[Y/N]:y

Directory flash:/1 removed. 

Related commands

delete

dir

mkdir

system-view

Use system-view to enter system view from user view.

Syntax

system-view

Views

User view

Examples

# Enter system view from user view.

<boot> system-view

[boot]

Related commands

quit

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网