From the course: Linux: Files and Permissions
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
File ownership - Linux Tutorial
From the course: Linux: Files and Permissions
File ownership
- [Instructor] Before we talk about setting permissions, we need to talk about file ownership. A file is owned by exactly one user and one group. If we do an ls -l on a file, we'll see that the long listing includes the file's owners. I'm using a fictitious file named file.txt as an example. You can do a long list on any file in your operating system to see similar data. The user owner is the third column from the left. The group owner is the fourth column. The command that we use to change the ownership of a file is chown. The syntax is chown space options space username colon group name space file name. To set the user owner, we'd just use one name, for instance, chown space user1 space file.txt, which would change the user owner to user1. Keep in mind that in order to change the ownership of a file, you need to be root or elevate privileges with sudo. To set the group owner, the syntax would be chown space :group space…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Standard Linux permissions overview1m 52s
-
(Locked)
File and directory modes1m 16s
-
(Locked)
File ownership3m 14s
-
(Locked)
Permissions using numeric notation3m 2s
-
(Locked)
Permissions using symbolic notation4m 44s
-
(Locked)
Initial permissions using umask4m 30s
-
(Locked)
Special file bits: SUID and SGID4m 59s
-
(Locked)
Special directory bits: SGID and Sticky5m 53s
-
(Locked)
Challenge: Permissions2m 16s
-
(Locked)
Solution: Permissions4m 19s
-
(Locked)
-
-