Directory execute permission determines whether you have access to files - and thus whether file permissions come into play. If you have execute permissions to a directory, file permissions for that directory become relevant. Otherwise, file permissions just don’t matter; you can’t access the files anyway.

7.1.3 Permissions in Practice

This section goes through a short example session to demonstrate how permissions are used. To change permissions, we’ll use the chmod command.

cd; touch myfile

There are a couple of new tricks here. First, you can use ; to put two commands on one line. You can type the above as:

$ cd
$ touch myfile

or as:

$ cd; touch myfile

Either way the same thing will end up happening.

Recall that cd by itself returns you to your home directory. touch is normally used to change the modification time of the file to the current time. But it has another interesting feature: If the file doesn’t exist, touch creates the file. So you’re using it to create a file to practice with. Use ls -l to confirm that the file has been created and notice the permissions mode: