What are other chmod commands?

Here are some common chmod commands for modifying file permissions in Linux:

Numeric Notation

  1. Add execute permission for the owner:

    chmod 700 filename

    (Owner can read, write, and execute; group and others have no permissions.)

  2. Add read and write permissions for the group:

    chmod 660 filename

    (Owner can read and write; group can read and write; others have no permissions.)

  3. Set read, write, and execute for everyone:

    chmod 777 filename

    (All users can read, write, and execute.)

Symbolic Notation

  1. Add execute permission for the owner:

    chmod u+x filename

    (Adds execute permission for the user/owner.)

  2. Remove write permission for the group:

    chmod g-w filename

    (Removes write permission for the group.)

  3. Set read permission for others:

    chmod o+r filename

    (Adds read permission for others.)

  4. Set permissions to read and execute for everyone:

    chmod a+rx filename

    (Adds read and execute permissions for all users.)

Recursive Changes

To change permissions for all files and directories within a directory:

chmod -R 755 directoryname

(This sets read, write, and execute for the owner, and read and execute for group and others for all files and subdirectories.)

Summary

These commands allow you to customize file permissions based on your needs. If you have specific scenarios in mind or need further examples, feel free to ask!

0 Comments

no data
Be the first to share your comment!