Solaris Advanced User's Guide

Typing Multiple Commands and Long Commands

You can type more than one command on a single line. Simply place a semicolon (;) between the commands, as shown here with the date command and the logname command:


$ date; logname
Tue Oct 31 15:16:00 MST 2000
spooky

This command entry displays the current date and time (from the date command) and the login name of the user currently logged in to the system (from the logname command).

If you are typing a long command, you can use the backslash character (\) to continue typing on a second line. For example:


$ date; \
logname
Tue Oct 31 15:17:30 MST 2000
spooky

Although the date and logname commands are not long commands, they demonstrate the concept of continuing a set of commands on the next line. Later, when the commands you want to use are longer than the width of your screen, you will see how useful the backslash character can be.


Note –

If you use a desktop window, you might not need to use the backslash character to continue typing commands on the next line. When you reach the end of a line, the commands you type wrap to the next line automatically, and the system executes all commands when you press Return.