From the course: Linux Foundation Certified System Administrator (LFCS) Cert Prep

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

List, set, and change standard file permissions

List, set, and change standard file permissions - Linux Tutorial

From the course: Linux Foundation Certified System Administrator (LFCS) Cert Prep

List, set, and change standard file permissions

- [Instructor] We'll now discuss how to list, set, and change standard file permissions in Linux. To understand how file and directory permissions work in Linux, we must first look at file directory owners. If we type in ls -l, we'll see something like this. Now any file or directory is owned by a user. In this case, we see that the file family_dog.jpg is owned by the user called Aaron. Only the owner of a file or directory can change permissions, and in this case, that's Aaron. The only exception is the root user, which can change permissions on any file or directory. In the second field, we can see that this file also has a group associated with it, the family group. We'll see later what the role of that group is. Now, to change the group of a file or directory, we can use the chgrp command, and chgrp means change group. Now generally, you type in chgrp, the group name, and the file or directory. Now for example, to change this files group to sudo, we'd use chgrp sudo family_dog.jpg…

Contents