Orientation
At the command line, your activity and the commands you run are in relation to the "current working directory". That is it say, you are always "standing" somewhere in your filesystem.
At any point, you can also run the pwd
(print working directory) command to find out where you are:
AlicesMac:~ alice$ pwd
/Users/alice
AlicesMac:~ alice$
There is also a notion of home, an area of the filesystem for your own files. This is where your documents, music etc. normally live as well. In the Finder, you can get to your home directory via the Favourites list on the left of the Finder window, or via Finder's menu (Go > Home).
At the command line, the tilde character (~
) always refers to your home path, and you can use it where ever you might normally use a full path.
For example, to jump to your home directory:
cd ~
Listing Files
ls
(list) displays the files and directories. If you don't give ls
a path, it will display the contents of the current directory.
Examples
- List the current directory:
ls
- List the /Users directory
ls /Users
ls
has many options for which entries should be shown and how. Useful options are la
, which list all entries with detail (size, date modified, etc):
- List details of current directory
ls -la