Specifications
22 Chapter 1 Executing Commands
Terminal presents a prompt when it is ready to accept a command. The prompt you see
depends on your Terminal and shell preferences, but it often includes the name of the
host you’re logged in to, your current working folder, your user name, and a prompt
symbol.
For example, if you’re using the default bash shell, the prompt appears as:
server1:~ anne$
where you are logged in to a computer named server1 as the user named anne, and
your current folder is anne’s home folder (~).
Throughout this manual, where a command is shown, the prompt is abbreviated as $.
Specifying Files and Folders
Most commands operate on files and folders, the locations of which are identified
by paths. The folder names that make up a path are separated by slash characters.
For example, the path to the Terminal application is
/Applications/Utilities/Terminal.app.
Standard shortcuts used to represent specific folders are shown in the following table.
Because they are relative to the current folder, these shortcuts eliminate the need to
enter full paths in many situations.
File and folder names traditionally include letters, numbers, a period, or the underscore
character. Avoid most other characters, including space characters. Although some
Mac OS X file systems permit the use of these other characters, including spaces, you
might need to add single or double quotation marks around pathnames that contain
them.
For individual characters, you can also “escape” the character—that is, put a backslash
character immediately before the character in your string. For example, the pathname
My Disk is “My Disk” or My\ Disk.
Path string Description
. A single period represents the current folder. This value is often used as a shortcut to
eliminate the need to enter in a full path. For example, the string “./Test.c” represents
the Test.c file in the current folder.
.. Two periods represent the parent folder of the current folder. This string is used
for navigating up one level from the current folder through the folder hierarchy.
For example, the string “../Test” represents a sibling folder (named Test) of the current
folder.
~ The tilde character represents the home folder of the user logged in.
In Mac OS X, this folder resides in the local /Users folder or on a network server.
For example, to specify the Documents folder of the current user, you would specify
~/Documents.