From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

File ownership

File ownership - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

File ownership

- Before we can talk about setting permissions, we need to talk about file ownership. A file is owned by exactly one user owner, and one group owner. If we do an ls-l on a file, we'll see that the long list includes the file's owners. I'm using a fictitious file name, file.txt as an example. You can do a long list on any file in your O.S. to see similar data. The user owner is the third column from the left. The group owner is the fourth column. The command we use to change the ownership of the file's called chown. The syntax is, chown space options, space user name, colon group name, space file name. To set the user owner we'd just use one name. For instance, chown space bob space file.txt, would change the user owner to bob. Keep in mind that in order to change the ownership of a file, you need to be either be root, or elevate privileges with sudo. To set the group owner, the syntax would be chown…

Contents