Linux Labs

Users, permissions, and processes / Stage 1 of 13

Users, groups, and process identity

Not running Starting usually ~20 s
Leave the lesson

Step 4 of 7 · on a machine · 4 min

Who owns the file

Every file has an owner. Two new files will show who becomes one.

Every file records one owner and one group, again as numbers: a UID and a GID. What the owner, the group, and everyone else may do is stored in the file's permissions, which the next lesson covers.

The owner and group are the third and fourth columns of ls -l. stat prints just the fields you ask for: %U is the owner name, %G the group name, %n the file name.

In the exercise, create two files in your directory, one with a plain command and one through sudo, and compare their owners with the summary's.

Exercise · look

Compare file owners

In ~/reports, create two files, one with your own command and one through sudo, then compare the owners of all three files.

First, predict

Who will own admin.txt, created with sudo touch in your directory?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in

Reading or renaming a file leaves its owner as it was. Changing the owner takes a separate command, chown, covered in the lesson on repairing permissions.

Ubuntu 24.04
Loading…