• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# cd
2
3
4## Command Function
5
6This command is used to change the current working directory.
7
8
9## Syntax
10
11cd [_path_]
12
13
14## Parameters
15
16**Table 1** Parameter description
17
18| Parameter| Description| Value Range|
19| -------- | -------- | -------- |
20| path | Specifies the path of the new directory. | You must have the execution (search) permission on the specified directory.|
21
22
23## Usage Guidelines
24
25- If **path** is not specified, this command switches to the root directory.
26
27- If **path** is specified, this command switches to the specified directory.
28
29- The **path** value starting with a slash (/) represents the root directory.
30
31- The **path** value starting with a dot (.) represents the current directory.
32
33- The **path** value starting with two dots (..) represents the parent directory.
34
35- You can run **cd -** to alternate between two directories that are recently accessed.
36
37
38## Example
39
40Run **cd ..**.
41
42
43## Output
44
45Parent directory information:
46
47```
48OHOS:/nfs$ cd ../
49OHOS:/$ ls
50bin  etc  nfs   sdcard   system  tmp  vendor
51dev  lib  proc  storage  test    usr
52```
53