Bash & Linux·Bash from first command to automation

Permissions

Read rwx permissions and change them without opening everything to the world.

Beginner 13 min read Lesson 3 of 300 Challenge included
What you will be able to do
  • Use ls -l to read permissions.
  • Use chmod with symbolic or numeric modes.
  • Use chown to change ownership.
  • Scripts need execute permission to run directly.

In plain English

Every file has an owner, a group and permissions for user, group and others. r is 4, w is 2 and x is 1. Use the smallest permission that works; 777 is almost always a mistake.

terminalTerminal
chmod +x deploy.sh
chmod 644 notes.txt
chmod 700 secrets/
ls -l deploy.sh notes.txt secrets
Your turn

Make a script executable

Easy

Add execute permission for the owner of a file named deploy.sh.

BASH · starter
chmod
Check your understanding before moving on.
Knowledge checkQuestion 1

What does permission 644 mean?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Pipes and redirection
Lesson 3 of 300 · 0% of course