Linux, terminal and Git

Stage 4 · Lesson 2 of 8

Users, groups, root and sudo

Permissions, processes and packages

is built for many on one machine. Each user has an ID number and belongs to one or more ; id shows yours. The root user, also called the superuser, can do anything.

So you work as a normal user and put sudo in front of single commands that need more power, such as installing packages. chown changes who owns a file. You usually need it after creating something with sudo by mistake. Adding a user to a group, such as docker, gives them that group's access.

Common traprunning everything with sudo, including npm install or commands, which leaves root-owned files in your home that later fail with "permission denied".

A question to check yourself, an AI practice session and 2 cheat sheet entries come when you add the roadmap to your account. Add it

Resources for this stage

Start with

  • BookFree
    The Linux Command Line

    William Shotts · Beginner

    Its chapters on permissions and processes are the clearest free explanation of this stage

Practise

Keep handy

  • The official README for installing nvm and switching Node versions per project

  • How brew installs, upgrades and cleans up the tools on your Mac

Also worth your time

  • See the users, permissions and process management branches of the Linux map

Mark this stage as not done?