Permissions et sécuritéCLI Manual
$chown
Change file owner and group attributes.
Syntaxe de la commandePOSIX Standard
chown [OPTIONS] OWNER[:GROUP] FILE...Essayer en direct dans le bac à sable interactif
Simulation côté client sans installation avec retour instantané.
bash — terminal
AST Sandbox (Free)
Aperçu et fonctionnement
`chown` (Change Owner) alters the user ownership and group association of files, directories, and links. System administrators frequently use `chown` when deploying web applications or restoring user permissions after file migrations.
Options et drapeaux courants
| Flag / Option | Description |
|---|---|
| -R | Recursively change ownership of directories and all contents. |
| -v | Verbose output reporting every ownership change executed. |
| -c | Report only when an actual change is made. |
Exemples pratiques du monde réel
#1Change owner of a file to user
chown user /var/log/syslog && ls -l /var/log/syslogAssigns user ownership to the system syslog file and checks with ls.
Commandes Linux associées
$chmodPermissions et sécurité
Modifier les permissions d'accès aux fichiers pour le propriétaire, le groupe et les autres.
$sudoPermissions et sécurité
Execute a command with superuser (root) security privileges.
$whoamiSystème et processus
Print the effective username associated with the current shell session.