Linux common commands-46: chown

The chown command is used to change the user and user group to which a file or folder belongs. Only super administrators have permission to execute it.

Syntax format: chown [parameter]

Common parameters:

Example

 # 将test.py文件的用户组和用户都改为xugaoxiang,冒号前的是用户,冒号后的是用户组,很多时候它们的名称是一样的chown xugaoxiang:xugaoxiang test.py # 递归修改文件夹chown -R root:root test

This article is reprinted from https://xugaoxiang.com/2022/06/14/linux-cmds-46-chown/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment

Your email address will not be published.