🎓 A1Learner
🔍
0 of 50 lessons completed

Owners and Groups

An owner is the user a file belongs to. A group is a set of users who share a file.

Your own numbers

The first number is the user number.

$ cd ~/practice
$ id

Your groups

One name prints here, since this user belongs to one group.

$ cd ~/practice
$ groups

Read the columns

The third column names the owner, and the fourth names the group.

$ cd ~/practice
$ ls -l projects/report.txt

Example

$ cd ~/practice
$ ls -l

Key points

  • Use id to see your user name and numbers.
  • Use groups to see the groups you belong to.
  • Every file names one owner and one group.
  • The names and numbers on your machine differ from the ones shown here.

In this example, Ls -l prints the whole practice folder at once. Four lines appear, one for each name. Each line carries an owner and a group. The first line is a file, and the other three lines are folders.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

Which column of ls -l names the group?