1 .\" Copyright (c) 2002 Andries Brouwer <aeb@cwi.nl>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .TH INTRO 1 2002-08-06 "Linux" "Linux User's Manual"
25 intro \- Introduction to user commands
27 Linux is a flavor of Unix, and as a first approximation
28 all user commands under Unix work precisely the same under
29 Linux (and FreeBSD and lots of other Unix-like systems).
31 Under Linux there are GUIs (graphical user interfaces), where you
32 can point and click and drag, and hopefully get work done without
33 first reading lots of documentation.
34 The traditional Unix environment
35 is a CLI (command line interface), where you type commands to
36 tell the computer what to do.
37 That is faster and more powerful,
38 but requires finding out what the commands are.
39 Below a bare minimum, to get started.
41 In order to start working, you probably first have to login,
42 that is, give your username and password.
49 (command interpreter) for you.
50 In case of a graphical login, you get a screen with menus or icons
51 and a mouse click will start a shell in a window.
55 One types commands to the
57 the command interpreter.
58 It is not built-in, but is just a program
59 and you can change your shell.
60 Everybody has her own favorite one.
61 The standard one is called
70 A session might go like
74 .BI "knuth login: " aeb
75 .BI "Password: " ********
77 Tue Aug 6 23:50:44 CEST 2002
91 drwxrwxr-x 2 aeb 1024 Aug 6 23:51 bin
92 -rw-rw-r-- 1 aeb 37 Aug 6 23:52 tel
96 .BI "% " "cp tel tel2"
99 drwxr-xr-x 2 aeb 1024 Aug 6 23:51 bin
100 -rw-r--r-- 1 aeb 37 Aug 6 23:52 tel
101 -rw-r--r-- 1 aeb 37 Aug 6 23:53 tel2
102 .BI "% " "mv tel tel1"
105 drwxr-xr-x 2 aeb 1024 Aug 6 23:51 bin
106 -rw-r--r-- 1 aeb 37 Aug 6 23:52 tel1
107 -rw-r--r-- 1 aeb 37 Aug 6 23:53 tel2
108 .BI "% " "diff tel1 tel2"
110 .BI "% " "grep maja tel2"
115 and here typing Control-D ended the session.
118 here was the command prompt \(em it is the shell's way of indicating
119 that it is ready for the next command.
120 The prompt can be customized
121 in lots of ways, and one might include stuff like user name,
122 machine name, current directory, time, etc.
123 An assignment PS1="What next, master? "
124 would change the prompt as indicated.
126 We see that there are commands
128 (that gives date and time), and
130 (that gives a calendar).
134 lists the contents of the current directory \(em it tells you what
136 With a \-l option it gives a long listing,
137 that includes the owner and size and date of the file, and the
138 permissions people have for reading and/or changing the file.
139 For example, the file "tel" here is 37 bytes long, owned by aeb
140 and the owner can read and write it, others can only read it.
141 Owner and permissions can be changed by the commands
148 will show the contents of a file.
149 (The name is from "concatenate and print": all files given as
150 parameters are concatenated and sent to "standard output", here
151 the terminal screen.)
155 (from "copy") will copy a file.
156 On the other hand, the command
158 (from "move") only renames it.
162 lists the differences between two files.
163 Here there was no output because there were no differences.
167 (from "remove") deletes the file, and be careful! it is gone.
168 No wastepaper basket or anything.
173 (from "g/re/p") finds occurrences of a string in one or more files.
174 Here it finds Maja's telephone number.
175 .SS "Pathnames and the current directory"
176 Files live in a large tree, the file hierarchy.
179 describing the path from the root of the tree (which is called /)
181 For example, such a full pathname might be /home/aeb/tel.
182 Always using full pathnames would be inconvenient, and the name
183 of a file in the current directory may be abbreviated by only giving
185 That is why "/home/aeb/tel" can be abbreviated
186 to "tel" when the current directory is "/home/aeb".
190 prints the current directory.
194 changes the current directory.
195 Try "cd /" and "pwd" and "cd" and "pwd".
199 makes a new directory.
203 removes a directory if it is empty, and complains otherwise.
207 (with a rather baroque syntax) will find files with given name
208 or other properties. For example, "find . \-name tel" would find
209 the file "tel" starting in the present directory (which is called ".").
210 And "find / \-name tel" would do the same, but starting at the root
211 of the tree. Large searches on a multi-GB disk will be time-consuming,
212 and it may be better to use
214 .SS "Disks and Filesystems"
217 will attach the filesystem found on some disk (or floppy, or CDROM or so)
218 to the big filesystem hierarchy. And
223 will tell you how much of your disk is still free.
225 On a Unix system many user and system processes run simultaneously.
226 The one you are talking to runs in the
232 will show you which processes are active and what numbers these
236 allows you to get rid of them. Without option this is a friendly
237 request: please go away. And "kill \-9" followed by the number
238 of the process is an immediate kill.
239 Foreground processes can often be killed by typing Control-C.
240 .SS "Getting information"
241 There are thousands of commands, each with many options.
242 Traditionally commands are documented on
244 (like this one), so that the command "man kill" will document
245 the use of the command "kill" (and "man man" document the command "man").
248 sends the text through some
252 Hit the space bar to get the next page, hit q to quit.
254 In documentation it is customary to refer to man pages
255 by giving the name and section number, as in
257 Man pages are terse, and allow you to find quickly some forgotten
258 detail. For newcomers an introductory text with more examples
259 and explanations is useful.
261 A lot of GNU/FSF software is provided with info files. Type "info info"
262 for an introduction on the use of the program "info".
264 Special topics are often treated in HOWTOs. Look in
265 .I /usr/share/doc/howto/en
266 and use a browser if you find HTML files there.
268 .\" Actual examples? Separate section for each of cat, cp, ...?
269 .\" gzip, bzip2, tar, rpm