In a Linux file system, what does the umask command do?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The umask command plays a crucial role in setting the default permissions for new files created within a Linux file system. When a new file or directory is created, the system assigns it a set of default permissions that are derived from a predetermined base set, typically 666 for files (read and write permissions) and 777 for directories (read, write, and execute permissions). The umask value then effectively subtracts permissions from this base set.

For example, if a user has a umask of 022, the permissions applied to new files would result in a default of 644 (read and write for the owner, and read-only for others), while new directories would have 755 permissions. This mechanism is essential for maintaining security and preventing unauthorized access to files and directories created by users.

The other options pertain to different aspects of file management in Linux. Changing file ownership relates to commands such as chown, displaying current permissions can be done using ls or stat commands, and modifying user groups involves commands like usermod or groupmod, none of which are associated with the umask command.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy