Study for the TestOut Linux Pro Exam with our engaging quiz. Prepare using our flashcards and comprehensive multiple choice questions, each with hints and explanations to help you succeed. Get ready for your Linux certification today!

Practice this question and more.


To ensure that all files in the /hr directory have the same permissions, which command would you use?

  1. chmod 755 /hr/*

  2. chmod 660 /hr/*

  3. chmod 644 /hr/*

  4. chmod 700 /hr/*

The correct answer is: chmod 660 /hr/*

The command that ensures all files in the /hr directory have the same permissions is the one that sets specific permissions for those files. In this context, using the chmod command with the appropriate numeric value indicates the permission levels that will be applied to the files. Each digit in the numeric value represents a different category of user access permissions: the first digit is for the owner, the second for the group, and the third for others. Choosing chmod 660 as the command means that the owner of the files will have read and write permissions, while the group will also have read and write permissions. However, others will have no permissions at all. This permission setting is often used for directories where only the owner and group members should be able to access or modify the files, which may be a common requirement for sensitive data within the /hr directory. In contrast, the other commands offer different permission levels. For instance, chmod 755 would allow the owner to read, write, and execute, while the group and others would only have read and execute permissions. This may be too permissive for some directories. Similar reasoning applies to chmod 644 (read and write for the owner, read for the group and others) and chmod 700 (full permissions for