These are the quickies, which we need to get started, and we will discuss them later in more detail:
Table 2-1. Quickstart commands
| Command | Meaning |
|---|---|
| ls | Displays a list of files in the current working directory, like the dir command in DOS |
| cd directory | change directories |
| passwd | change the password for the current user |
| file filename | display file type of file with name filename |
| cat textfile | throws content of textfile on the screen |
| pwd | display present working directory |
| exit or logout | leave this session |
| man command | read man pages on command |
| info command | read Info pages on command |
| apropos string | search the whatis database for strings |
In Linux, like in UNIX, directories are separated using forward slashes, like the ones used in web addresses (URLs). We will discuss directory structure indepth later.
The symbols . and .. have special meaning when directories are concerned. We will try to find out about those during the exercises, and more in the next chapter.
Try to avoid logging in with or using the system administrator's account, root. Besides doing your normal work, most tasks, including checking the system, collecting information etc., can be executed using a normal user account with no special permissions at all. If needed, for instance when creating a new user or installing new software, the preferred way of obtaining root access is by switching user IDs, see Section 3.2.1 for an example.
Almost all commands in this book can be executed without system administrator priviledges. In most cases, when issuing a command or starting a program as a non-privileged user, the system will warn you or prompt you for the root password when root access is required. Once you've done, leave the application or session that gives you root privileges immediately.
Reading documentation should become your second nature. Especially in the beginning, it is important to read system documentation, manuals for basic commands, HOWTOs and so on. Since the amount of documentation is so enormous, it is impossible to include all related documentation. This book will try to guide you to the most appropriate documentation on every subject discussed, in order to stimulate the habit of reading the man pages.
A lot of beginning users fear the man (manual) pages, because they are an overwhelming source of documentation. They are, however, very structured, as you will see from the example below on: man man.
Reading man pages is usually done in a terminal window when in graphical mode, or just in text mode if you prefer it. Type the command like this at the prompt, followed by enter:
yourname@yourcomp ~> man man |
The documentation for man will be displayed on your screen. Browse to the next page using the space bar. You can go back to the previous page using the b-key. When you reach the end, man will quit and you get the prompt back, or type q if you want to leave the man page before reaching the end.
Each man page usually contains a couple of standard sections, as we can see from the man man example:
The first line contains the name of the command you are reading about, and the id of the section in which this man page is located. The man pages are ordered in chapters. Commands are likely to have multiple man pages, for example the man page from the user section, the man page from the system admin section, and the man page from the programmer section.
The name of the command and a short description are given, which is used for building an index of the man pages. You can look for any given search string in this index using the apropos command.
The synopsis of the command provides a technical notation of all the options and/or arguments this command can take. You can think of an option as a way of executing the command. The argument is what you execute it on. Some commands have no options or no arguments.
A longer description of the command is given.
Options with their descriptions are listed. Options can usually be combined. If not so, this section will tell you about it.
Environment describes the shell variables that influence the behavior of this command (not all commands have this).
Sometimes sections specific to this command are provided, such as the CAT PAGES section in the example.
A reference to other man pages is given in the SEE ALSO section. In between parentheses is the number of the man page section in which to find this command. Experienced users often switch to the SEE ALSO part using the / command followed by the search string SEE and [ENTER].
Usually there is also information about known bugs (anomalies) and where to report new bugs you may find.
There might also be author and copyright information.
In addition to the man pages, you can read the info pages about a command, using the info command. These usually contain more recent information and are somewhat easier to use. The man pages for some commands refer to the info pages.
Get started with info info. Use the arrow keys to browse trough the text and move the cursor on a line starting with an asterisk, containing the keyword about which you want info. Use the p- and n-keys to go to the previous or next subject. The space bar will move you one page further, no matter whether this starts a new subject or an info page for another command. Use q to quit. The info program has more information.