The cd command changes the current working directory of a user.
By default, the current working directory is flash:.
Parameter | Description | Value |
---|---|---|
directory |
Specifies the current working directory of a user. |
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: ~ * / \ : ' " For example, a directory name is flash:/selftest/test/. |
Usage Scenario
For example, if you change the current working directory flash:/selftest/ to the logfile directory in flash, the absolute path is flash:/logfile/, and the relative path is /logfile/. The logfile directory is not logfile/ because it is not in the current working directory selftest.
Precautions
The directory specified in the cd command must exist; otherwise, the error messages will displayed:
# Change the current working directory from flash:/temp to flash:.
<HUAWEI> pwd flash:/temp <HUAWEI> cd flash: <HUAWEI> pwd flash:
# Change the current working directory from flash: to flash:/t1/t2.
<HUAWEI> pwd flash: <HUAWEI> cd flash:/t1/t2 <HUAWEI> pwd flash:/t1/t2
# Change the current working directory from flash:/selftest to flash:/logfile.
<HUAWEI> pwd flash:/selftest <HUAWEI> cd /logfile/ <HUAWEI> pwd flash:/logfile
# Change the current working directory from flash:/selftest to flash:/selftest/test.
<HUAWEI> pwd flash:/selftest <HUAWEI> cd test/ <HUAWEI> pwd flash:/selftest/test