1 .\" Copyright (c) 2002 Andries Brouwer <aeb@cwi.nl>
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH intro 1 (date) "Linux man-pages (unreleased)"
7 intro \- introduction to user commands
9 Section 1 of the manual describes user commands and tools,
10 for example, file manipulation tools, shells, compilers,
11 web browsers, file and image viewers and editors, and so on.
13 Linux is a flavor of UNIX, and as a first approximation
14 all user commands under UNIX work precisely the same under
15 Linux (and FreeBSD and lots of other UNIX-like systems).
17 Under Linux, there are GUIs (graphical user interfaces), where you
18 can point and click and drag, and hopefully get work done without
19 first reading lots of documentation.
20 The traditional UNIX environment
21 is a CLI (command line interface), where you type commands to
22 tell the computer what to do.
23 That is faster and more powerful,
24 but requires finding out what the commands are.
25 Below a bare minimum, to get started.
27 In order to start working, you probably first have to open a session by
28 giving your username and password.
33 (command interpreter) for you.
34 In case of a graphical login, you get a screen with menus or icons
35 and a mouse click will start a shell in a window.
39 One types commands to the
41 the command interpreter.
42 It is not built-in, but is just a program
43 and you can change your shell.
44 Everybody has their own favorite one.
45 The standard one is called
56 A session might go like:
60 .RB "knuth login: " aeb
61 .RB "Password: " ********
63 Tue Aug 6 23:50:44 CEST 2002
77 drwxrwxr\-x 2 aeb 1024 Aug 6 23:51 bin
78 \-rw\-rw\-r\-\- 1 aeb 37 Aug 6 23:52 tel
82 .RB "$ " "cp tel tel2"
85 drwxr\-xr\-x 2 aeb 1024 Aug 6 23:51 bin
86 \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:52 tel
87 \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:53 tel2
88 .RB "$ " "mv tel tel1"
91 drwxr\-xr\-x 2 aeb 1024 Aug 6 23:51 bin
92 \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:52 tel1
93 \-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:53 tel2
94 .RB "$ " "diff tel1 tel2"
96 .RB "$ " "grep maja tel2"
102 Here typing Control-D ended the session.
106 here was the command prompt\[em]it is the shell's way of indicating
107 that it is ready for the next command.
108 The prompt can be customized
109 in lots of ways, and one might include stuff like username,
110 machine name, current directory, time, and so on.
111 An assignment PS1="What next, master? "
112 would change the prompt as indicated.
114 We see that there are commands
116 (that gives date and time), and
118 (that gives a calendar).
122 lists the contents of the current directory\[em]it tells you what
126 option it gives a long listing,
127 that includes the owner and size and date of the file, and the
128 permissions people have for reading and/or changing the file.
129 For example, the file "tel" here is 37 bytes long, owned by aeb
130 and the owner can read and write it, others can only read it.
131 Owner and permissions can be changed by the commands
138 will show the contents of a file.
139 (The name is from "concatenate and print": all files given as
140 parameters are concatenated and sent to "standard output"
144 the terminal screen.)
148 (from "copy") will copy a file.
152 (from "move"), on the other hand, only renames it.
156 lists the differences between two files.
157 Here there was no output because there were no differences.
161 (from "remove") deletes the file, and be careful! it is gone.
162 No wastepaper basket or anything.
167 (from "g/re/p") finds occurrences of a string in one or more files.
168 Here it finds Maja's telephone number.
169 .SS Pathnames and the current directory
170 Files live in a large tree, the file hierarchy.
173 describing the path from the root of the tree (which is called
176 For example, such a full pathname might be
178 Always using full pathnames would be inconvenient, and the name
179 of a file in the current directory may be abbreviated by giving
180 only the last component.
186 when the current directory is
191 prints the current directory.
195 changes the current directory.
203 usage: "cd", "cd .", "cd ..", "cd /", and "cd \[ti]".
207 makes a new directory.
211 removes a directory if it is empty, and complains otherwise.
215 (with a rather baroque syntax) will find files with given name
217 For example, "find . \-name tel" would find
220 starting in the present directory (which is called
222 And "find / \-name tel" would do the same, but starting at the root
224 Large searches on a multi-GB disk will be time-consuming,
225 and it may be better to use
227 .SS Disks and filesystems
230 will attach the filesystem found on some disk (or floppy, or CDROM or so)
231 to the big filesystem hierarchy.
237 will tell you how much of your disk is still free.
239 On a UNIX system many user and system processes run simultaneously.
240 The one you are talking to runs in the
246 will show you which processes are active and what numbers these
250 allows you to get rid of them.
251 Without option this is a friendly
252 request: please go away.
253 And "kill \-9" followed by the number
254 of the process is an immediate kill.
255 Foreground processes can often be killed by typing Control-C.
256 .SS Getting information
257 There are thousands of commands, each with many options.
258 Traditionally commands are documented on
260 (like this one), so that the command "man kill" will document
261 the use of the command "kill" (and "man man" document the command "man").
264 sends the text through some
268 Hit the space bar to get the next page, hit q to quit.
270 In documentation it is customary to refer to man pages
271 by giving the name and section number, as in
273 Man pages are terse, and allow you to find quickly some forgotten
275 For newcomers an introductory text with more examples
276 and explanations is useful.
278 A lot of GNU/FSF software is provided with info files.
280 for an introduction on the use of the program
283 Special topics are often treated in HOWTOs.
285 .I /usr/share/doc/howto/en
286 and use a browser if you find HTML files there.
288 .\" Actual examples? Separate section for each of cat, cp, ...?
289 .\" gzip, bzip2, tar, rpm