Читать книгу Linux Bible - Christopher Negus - Страница 83
Using the shell prompt
ОглавлениеIf your Linux system has no graphical user interface (or one that isn't working at the moment), you will most likely see a shell prompt after you log in. Typing commands from the shell will probably be your primary means of using the Linux system.
The default prompt for a regular user is simply a dollar sign:
$
The default prompt for the root user is a pound sign (also called a number sign or a hash tag):
#
In most Linux systems, the $
and #
prompts are preceded by your username, system name, and current directory name. For example, a login prompt for the user named jake
on a computer named pine
with /usr/share/
as the current working directory would appear as follows:
[jake@pine share]$
You can change the prompt to display any characters you like and even read in pieces of information about your system. For example, you can use the current working directory, the date, the local computer name, or any string of characters as your prompt. To configure your prompt, see the section “Setting your prompt” later in this chapter.
Although a tremendous number of features are available with the shell, it's easy to begin by just entering a few commands. Try some of the commands shown in the remaining sections to become familiar with your current shell environment.
In the examples that follow, the dollar ($
) and pound (#
) symbols indicate a prompt. A $
indicates that the command can be run by any user, but a #
typically means that you should run the command as the root user; that is, many administrative tools require root permission to be able to run them. The prompt is followed by the command that you type (and then press Enter). The lines that follow show the output resulting from the command.