2.2. Absolute basics

2.2.1. The commands

These are the quickies, which we need to get started, and we will discuss them later in more detail:

Table 2-1. Quickstart commands

CommandMeaning
ls

Displays a list of files in the current working directory, like the dir command in DOS

cd directory

change directories

passwdchange the password for the current user
file filenamedisplay file type of file with name filename
cat textfilethrows content of textfile on the screen
pwddisplay present working directory
exit or logoutleave this session
man commandread man pages on command
info commandread Info pages on command
apropos stringsearch the whatis database for strings

2.2.2. General remarks

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.

2.2.3. 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:

2.2.4. More info

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.