avatar
Linux для чайника
@linuxdevs
10.06.2024 10:17
Команда id может принимать различные параметры, которые позволяют отображать только определенную информацию.

Например чтобы распечатать только действующий идентификатор пользователя, используйте параметр -u:

$ id -u

1000

Используйте параметр -G ( --groups ), чтобы распечатать эффективные идентификаторы всех групп, к которым принадлежит пользователь:

$ id -G

1000 4 20 24 25 27 29 30 44 46 109 119 121 133 141

Вызвать справку:
$ id --help


Usage: id [OPTION]... [USER]...
Print user and group information for each specified USER,
or (when USER omitted) for the current process.

-a ignore, for compatibility with other versions
-Z, --context print only the security context of the process
-g, --group print only the effective group ID
-G, --groups print all group IDs
-n, --name print a name instead of a number, for -ugG
-r, --real print the real ID instead of the effective ID, with -ugG
-u, --user print only the effective user ID
-z, --zero delimit entries with NUL characters, not whitespace;
not permitted in default format
--help display this help and exit
--version output version information and exit

Without any OPTION, print some useful set of identified information.


#linux #commands #doc
21 3.4K

Обсуждение 0

Обсуждение не доступно в веб-версии. Чтобы написать комментарий, перейдите в приложение Telegram.

Обсудить в Telegram

Linux для чайника

3.9K
Все о свободном программном обеспечении и операционной системе Linux
Открыть в Telegram