Here you can see the permissions settings for each le/directory in the rst column on the left.
“drwxrwxrwx” is the most you’ll see. The “d” identies the object as a directory. If there is a “-”
where the “d” is supposed to be, that identies the object as a le. Following the rst character,
there is the potential for three sets of the characters “rwx”. On le systems there are three types
of users who can be assigned permissions: Owner, Group, EveryoneElse. Each trio of “rwx”
characters represents one of the three entities above, in the same respective order. Also, three
types of permissions can be documented for a given le/directory: Read, Write, Execute (rwx).
So, for each le directory, the permissions documentation tells you:
• If it is it a le or directory
• Whether the owner can read, write, and/or execute
• Whether the people in a certain group can read, write, and/or execute
• Whether everyone else who comes into contact with it can read, write, and/or execute
In the ls -l results you can also see things such as the owner (bertramlyons), the group that the
le is part of (sta), the lesize, and the date last modied.
Adding the -a or -R option to the ls command will give you much more; -a reveals any hidden
les, -R reads recursively through all directories. Try it for yourself.
Bertrams-MacBook-Air:~ bertramlyons$ ls -a -l -R
The ls command has many, many options, and is worth learning. For example, ls -F will postx a
slash (/) on every directory and an asterisk (*) on every executable le.
Changing DireCtories
Now that you can see what is in your current directory, you may decide to navigate to a dierent
directory. To change the current directory, use the cd command, as in:
Bertrams-MacBook-Air:~ bertramlyons$ cd Documents
Bertrams-MacBook-Air:Documents bertramlyons$ pwd
/Users/bertramlyons/Documents
You are now in your Documents directory, just as if you had double clicked on the Documents
folder in the Finder. Note how the prompt has changed to include the path “~/Documents”.
Remember, you can get a list of all the documents in this directory with the ls (list) command:
Bertrams-MacBook-Air:Documents bertramlyons$ ls -l
total 11136
-rw-r--r-- 1 bertramlyons staff 5698278 Mar 18 12:56 FileZilla_3.7.4.1_
i686-apple-darwin9.app.tar.bz2
drwxr-xr-x 6 bertramlyons staff 204 Jun 6 12:55 Microsoft User Data
drwxr-xr-x 2 bertramlyons staff 68 Jan 14 2014 WebEx
There are two directories and one le in my Documents folder.
Using the cd command has many options and shortcuts. The example above uses the cd
command to move into a directory that is within the current working directory. That is why we
3
Using the Command Line Interface: Mac OS