SAGARFIVE

File and Folder Ownership change

Scenario

Command

Description

Change owner and group of backups directory

sudo chown appuser:admins backups

Sets owner to appuser and group to admins

Change owner and group using absolute path

sudo chown appuser:admins /opt/backups

Applies ownership to /opt/backups

Change owner and group recursively

sudo chown -R appuser:admins backups

Applies to all files and subdirectories

Change only owner

sudo chown appuser backups

Changes only the owner

Change only group

sudo chown :admins backups

Changes only the group

Verify ownership

ls -ld backups

Displays current owner and group