Unix Numeric (Octal) Permissions

$ chmod 640 foo.txt
User Group Other
Read +400 +40 +4
Write +200 +20 +2
Execute +100 +10 +1

Show permissions on linux:

$ stat foo.txt
$ stat -c '%a %n' foo.txt

Show permissions on BSD:

$ stat -x foo.txt
$ stat -f '%OLp' foo.txt

(The sticky bit was originally introduced to keep the text segment of an executable remain resident in memory, to make subsequent execution of that program start faster. This behavior is no longer widely supported.)