Home/chmod 4240

Chmod 4240

Owner can write. Group can read. Others have no permissions. SETUID bit is set.

Numeric Notation

4240

Symbolic Notation

-wSr-----

Command

chmod 4240 file

Permission Breakdown

Detailed view of permissions for each user category

Owner
Read Write Execute
Group
Read Write Execute
Others
Read Write Execute
Special Permissions
✓ SETUID bit is set

For Files

chmod 4240 filename.txt
Changes permissions of a single file
chmod 4240 *.txt
Changes permissions of all .txt files
After applying chmod 4240, files will display as:
-wSr----- filename.txt

For Directories

chmod 4240 dirname
Changes permissions of a directory
chmod -R 4240 dirname
Recursively changes all files and subdirectories
After applying chmod 4240, directories will display as:
d-wSr----- dirname

Common Use Cases for Chmod 4240

1
Shared Reading
Files that need to be readable by multiple users or groups.
2
Restricted Access
Files with restricted access, not available to public users.
3
General Purpose
This permission set is useful when you need , write access.

Related Chmod Codes

Explore similar permission configurations

Try the Interactive Calculator

Experiment with different permission combinations

Understanding Chmod 4240

The chmod 4240 command sets specific file permissions in Linux and Unix systems. This permission configuration owner can write. group can read. others have no permissions. setuid bit is set.

In the numeric notation 4240, each digit represents the permission level for different user categories. The symbolic representation -wSr----- provides a visual way to understand these permissions, where 'r' means read, 'w' means write, 'x' means execute, and '-' means no permission.

When you execute chmod 4240 filename, you're modifying the file's access control list to match this specific permission pattern. This is essential for maintaining proper security and access control in multi-user environments.