How do I identify the number (integer value) of a particular group associated with a file?
ls -l
drwxr-x--x root system 2014-11-26 10:59 xyz
I have managed to check that group id of root is 0
. What is the corresponding number of group id for system ?
I need to change the group of my file to system. How do I do it using chown ? gid_t is internally of int type. So what value should I pass to make it system? How do I know?
Check with AID_XXX Ex: AID_SYSTEM
in the source code. The corresponding value is the integer value of it.
AID_SYSTEM is 1000
Similarly it can be found for other groups as well.
I don't know if there is a better way.
At adb shell
su 1000
since 1000 is the system uid
id
This returns
uid=1000(system) gid=1000(system)
So gid for system is 1000 too
Since you're talking about files specifically, the easiest way is just ls -n
:
$ ls -ld /data
drwxrwx--x system system 2015-06-04 11:59 data
$ ls -ldn /data
drwxrwx--x 1000 1000 2015-06-04 11:59 data
chgrp 1000 /path/filename
1000 is the system group id, and also the system user id
chgrp
is included in busybox
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.