Glossary

umask

The permission bits automatically removed from new files.

The umask is a per-process mask subtracted from the permissions requested when a file or directory is created. With the common default of 022, a directory requested as 777 is created as 755 and a file requested as 666 becomes 644.

This is why new files are never group- or world-writable by default, and why "I created it with 777 and it came out 755" is not a bug. Check yours by typing umask; set it in ~/.bashrc if you need different defaults.

See it in practice

$ umask && mkdir demo && ls -ld demo

With the usual umask of 022, the new directory comes out 755 rather than 777 — the mask removed the write bits.

Where you'll meet it

chmod

Change file permissions with numeric (755, 644) and symbolic (u+x) modes — clearly explained.

mkdir

Create one or many directories, including whole nested paths with -p.

File permissions

Who may read, write and execute — nine bits per file.

Learn these concepts by typing them: the interactive course builds them up lesson by lesson in a real simulated shell.