Basic Unix Commands
If you’ve never used Unix before, this section will serve as a quick introduction to issuing Unix commands from the Terminal. Experienced Unix users can skip over this section. For each of the following, you will need to be using the Terminal application. The commands you need to type are shown in bold.
- View a command’s description and its options?
All the Unix commands on your system have a manual page (or
manpagefor short). To view the manpage for any command, you use themancommand:[macchuck:~] chuck%
man pwdThe instructions for using the
pwdcommand (described next) are then displayed one screen at a time. If there is more than one screen for a command’s description, you will see a percentage at the lower-left corner of the Terminal window telling you how much of the manpage has been viewed. To scroll to the next screen, hit the spacebar; you will be returned to the command prompt when you’ve reached the end of the manpage. Themancommand even has its own manpage, which can be viewed by using:[macchuck:~] chuck%
man man- Where am I?
Type
pwdon the command line, and hit Return; this will tell you the present working directory.[macchuck:~] chuck%
pwd/Users/chuck [macchuck:~] chuck%The default
tcshcommand prompt will show you what directory you’re in, but only to a point; for example:[macchuck:Applications/Extras/Bluetooth] chuck%
pwd/Developer/Applications/Extras/Bluetooth [macchuck:Applications/Extras/Bluetooth] chuck%As this example shows, at first ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access