Menu
Coddy logo textTech

Understanding Permissions

Part of the Fundamentals section of Coddy's Terminal journey — lesson 53 of 82.

Every file and directory in Linux has permissions that control who can access it and what they can do with it. This security system prevents unauthorized users from reading your private files or modifying important system files.

Permissions are divided into three types of actions:

  • Read (r) - View the contents of a file or list a directory's contents
  • Write (w) - Modify a file or add/remove files in a directory
  • Execute (x) - Run a file as a program or enter a directory

These permissions are assigned to three different categories of users:

  • Owner - The user who created the file
  • Group - A set of users who share access
  • Others - Everyone else on the system

When you run ls -l, the first column shows the permission string. It looks something like -rwxr-xr--. This string tells you exactly who can do what with that file.

In the upcoming lessons, you'll learn how to read this string and modify permissions to control access to your files.

challenge icon

Challenge

Easy

Use the ls -l command to view the detailed listing of files in your current directory. This will display the permission strings for each file and directory.

Examine the output and identify the permission string for script.sh. Notice how the first column shows a 10-character string that represents the file type and permissions.

Run the command:

ls -l

In the output, you'll see entries for both files and the documents directory. Pay attention to:

  • The first character: - for files, d for directories
  • The next 9 characters showing read (r), write (w), and execute (x) permissions
  • The owner and group names that appear after the permission string

This is your first look at how Linux displays permission information. In the next lessons, you'll learn to read these strings in detail and modify them.

Cheat sheet

Linux uses permissions to control file and directory access. There are three types of actions:

  • Read (r) - View file contents or list directory contents
  • Write (w) - Modify a file or add/remove files in a directory
  • Execute (x) - Run a file as a program or enter a directory

Permissions are assigned to three categories of users:

  • Owner - The user who created the file
  • Group - A set of users who share access
  • Others - Everyone else on the system

To view file permissions, use:

ls -l

The first column shows a 10-character permission string (e.g., -rwxr-xr--):

  • First character: - for files, d for directories
  • Next 9 characters: read (r), write (w), and execute (x) permissions for owner, group, and others

Try it yourself

Terminal
ls -l
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals