kernel-small-debug-shell-file-chown.md 855 字节
Newer Older
A
Annie_wang 已提交
1
# chown
D
duangavin123 已提交
2

A
Annie_wang 已提交
3 4

## Command Function
W
wenjun 已提交
5

D
duangavin123 已提交
6
This command is used to change the owner of a file.
W
wenjun 已提交
7

A
Annie_wang 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

## Syntax

chown [_owner_] [_pathname_]


## Parameters

**Table 1** Parameter description

| Parameter    | Description    | Value Range      |
| -------- | ------------ | -------------- |
| owner    | Specifies the file owner. | [0, 0xFFFFFFFF] |
| pathname | Specifies the file path. | An existing file |


## Usage Guidelines
W
wenjun 已提交
25

D
duangavin123 已提交
26
This command does not apply to the FAT file system.
W
wenjun 已提交
27

A
Annie_wang 已提交
28 29 30
## Note

Currently, the shell does not support this command.
W
wenjun 已提交
31

A
Annie_wang 已提交
32
## Example
W
wenjun 已提交
33

A
Annie_wang 已提交
34
Run **chown 100 testfile**.
W
wenjun 已提交
35

A
Annie_wang 已提交
36 37 38 39

## Output

Change the UID of the **testfile** file in **/dev** to **100**.
D
duangavin123 已提交
40 41 42 43 44 45 46 47 48

```
OHOS:/dev$ touch testfile
OHOS:/dev$ ll testfile
-rw-r--r-- 0 0 100 0 1970-01-01 00:00 testfile
OHOS:/dev$ chown 100 testfile
OHOS:/dev$ ll testfile
-rw-r--r-- 0 100 100 0 1970-01-01 00:00 testfile
```