14

To type a command:

mWait for a prompt to appear in the Terminal window, then type the command and press Return.

If you get the message command not found, check your spelling. If the error recurs, the program you’re trying to run might not be in your default search path. Add the path before the program name or change your working directory to the directory that contains the program. For example:

[server:/] admin$ serversetup -getAllPort serversetup: Command not found.

[server:/] admin$ /System/Library/ServerSetup/serversetup -getAllPort 1

Built-in Ethernet

[server:/] admin$ cd /System/Library/ServerSetup [server:/System/Library/ServerSetup] admin$ ./serversetup -getAllPort 1

Built-in Ethernet [server:/System/Library/ServerSetup] admin$ cd / [server:/] admin$ PATH = "$PATH:/System/Library/ServerSetup"

[server:/] admin$ serversetup -getAllPort 1

Built-in Ethernet

Correcting Typing Errors

To correct a typing error before you press Return to issue the command, use the Delete key or press Control-H to erase unwanted characters and retype.

To ignore what you have typed and start again, press Control-U.

Repeating Commands

To repeat a command, press Up-Arrow until you see the command, then press Return.

To repeat a command with modifications, press Up-Arrow until you see the command, press Left-Arrow or Right-Arrow to skip over parts of the command you don’t want to change, press Delete to remove characters, type regular characters to insert them, then press Return to execute the command.

Including Paths Using Drag-and-Drop

To include a fully-qualified file name or directory path in a command, stop typing where the item is required in the command and drag the folder or file from a Finder window into the Terminal window.

Chapter 1 Typing Commands

Page 14
Image 14
Apple oxs manual Correcting Typing Errors, Repeating Commands, Including Paths Using Drag-and-Drop, To type a command