< Home

Logging In to the Device to Manage Files

Pre-configuration Tasks

Before logging in to the device to manage files, complete the following tasks:

  • Ensure that routes are reachable between the terminal and the device.
  • Ensure that a user has logged in to the device using a terminal.

Configuration Procedure

After a user logs in to the device on a terminal, the user can perform operations on storage media, directories, and files.

Users can perform the following operations in any sequence.

Procedure

  • Perform operations on directories.

    Table 1 Performing operations on directories

    Operation

    Command

    Description

    Display the current directory.

    pwd

    -

    Change the current directory.

    cd directory

    -

    Display files and subdirectories in a specified directory.

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

    -

    Create a directory.

    mkdir directory

    -

    Delete a directory.

    rmdir directory

    • The directory to be deleted must be empty.

    • A deleted directory and its files cannot be restored from the recycle bin.

  • Perform operations on files.

    Table 2 Performing operations on files

    Operation

    Command

    Description

    Display the file content.

    more filename [ offset ] [ all ]

    -

    Copy a file.

    copy source-filename destination-filename

    • Before copying a file, ensure that the storage space is sufficient for the file.
    • If the target file has the same name as an existing file, the system asks you whether to overwrite the existing file.

    Download a file from or upload a file to an HTTP server.

    copy { source-http-urlname destination-filename | source-filename destination-http-urlname } [ username user-name password password ]

    Only V200R013C00SPC500 or a later version supports this function.

    Download a file from or upload a file to an HTTPS server.

    copy { source-https-urlname destination-filename | source-filename destination-https-urlname } [ username user-name password password ] ssl-policy ssl-policy

    Only V200R013C00SPC500 or a later version supports this function.

    Move a file.

    move source-filename destination-filename

    If the target file has the same name as an existing file, the system asks you whether to overwrite the existing file.

    Rename a file.

    rename old-name new-name

    -

    Compress a file.

    zip source-filename destination-filename

    -

    Decompress a file.

    unzip source-filename destination-filename

    -

    Delete a file.

    delete [ /unreserved ] [ /quiet ] { filename | devicename }

    This command cannot delete a directory.

    NOTICE:

    In this command, /unreserved indicates that the file cannot be restored.

    Restore a file.

    undelete { filename | devicename }

    Running the delete command without the /unreserved keyword moves a file to the recycle bin. Run this command to restore this file.

    Remove a file from the recycle bin.

    reset recycle-bin [ filename | devicename ]

    Remove a file from the recycle bin to permanently delete it.

    Enter the system view.

    system-view

    -

    Execute batch files.

    execute batch-filename

    To perform multiple operations at one time, run the execute batch-filename command in the system view. The batch files must be stored in the storage medium first.

    If an error message similar to "Cannot xxx, because it may be locked or no lock available." is displayed during the execution of a command on a file, wait for a certain period and execute this command again. If this message is still displayed after you execute the command multiple times, contact Huawei engineers.

  • Perform operations on storage media.

    When the file system on a storage medium fails, the terminal prompts the user to rectify the fault.

    When the file system fault cannot be rectified or the data on the storage medium is unnecessary, you can format the storage medium.

    When a storage medium is formatted, data on the storage medium is cleared and cannot be restored. Therefore, exercise caution when formatting a storage medium.

    Table 3 Performing operations on storage media

    Operation

    Command

    Description

    Repair a storage medium with a faulty file system.

    fixdisk drive

    If the system still reports the fault after this command is executed, the storage medium is damaged.

    Format a storage medium.

    format drive

    If the storage medium is still unavailable after it is formatted, a physical exception occurs.

  • Configure the notification mode of the file system.

    When a user performs operations that may cause data loss or damage on a device, the system generates notifications or alarms. Users can configure the notification mode of the file system.

    Table 4 Configuring the notification mode of the file system

    Operation

    Command

    Description

    Enter the system view.

    system-view

    -

    Configure the notification mode of the file system.

    file prompt { alert | quiet }

    The default notification mode is alert.

    NOTICE:

    If the notification mode is set to quiet, the system does not provide notifications when data is lost caused by user misoperations such as deleting files. Therefore, this notification mode must be used with caution.

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