← 返回命令列表

Linux command

vipw 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Example

sudo vipw

Example

sudo vipw -s

Example

sudo vipw -g

Example

vipw -V

说明

vipw safely edits the password file (/etc/passwd). It locks the file to prevent simultaneous edits, runs an editor, and validates the file format before saving. Using vipw instead of directly editing the password file prevents corruption from concurrent access and syntax errors.

参数

-g, --group
Edit the group file (/etc/group). Equivalent to invoking as `vigr`.
-p, --passwd
Edit the passwd file (default).
-s, --shadow
Edit the shadow password file (/etc/shadow) or shadow group file (/etc/gshadow) when combined with -g.
-q, --quiet
Quiet mode.
-h, --help
Display help and exit.
-V, --version
Display version information.

FAQ

What is the vipw command used for?

vipw safely edits the password file (/etc/passwd). It locks the file to prevent simultaneous edits, runs an editor, and validates the file format before saving. Using vipw instead of directly editing the password file prevents corruption from concurrent access and syntax errors.

How do I run a basic vipw example?

Run `sudo vipw` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -g, --group do in vipw?

Edit the group file (/etc/group). Equivalent to invoking as `vigr`.