# Let's first create a directory and look at its default # permissions. mkdir dir touch dir/file.txt ls -ld dir echo set -x # print what is going on # Then remove all the ‘execute’ bits: chmod 644 dir cd dir # permission error ls dir # ok echo # Let's now try with «only» the execute bits: chmod 111 dir cd dir # ok ls # not ok cd .. echo # How about ‹r-x------›? i.e. deny writing to ourselves chmod 500 dir rm dir/file.txt # not ok echo # Go back to where we started and clean up. chmod 755 dir rm dir/file.txt rmdir dir # Next up: ‹umask.sh›.