How To Change File Permissions Linux?

Use `chmod` to change file permissions

Add execute permission: `chmod +x filename`

Remove execute permission: `chmod -x filename`

Set read, write, and execute for owner: `chmod u+rwx filename`

Set read and write for group: `chmod g+rw filename`

Set read permission for others: `chmod o+r filename`

Use numeric mode to set permissions: `chmod 755 filename`

Use numeric mode to set read and write for owner, read for group and others: `chmod 644 filename`

Change permissions recursively for a directory: `chmod -R 755 directory`

Check current permissions with `ls -l filename`

Change file owner with `chown user filename`

Change group with `chgrp group filename`

Change owner and group together: `chown user:group filename`

Suggested for You

Trending Today