]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man1/intro.1
resolver.3: RES_IGNTC is implemented
[thirdparty/man-pages.git] / man1 / intro.1
CommitLineData
fea681da
MK
1.\" Copyright (c) 2002 Andries Brouwer <aeb@cwi.nl>
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
988db661 12.\"
fea681da
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
988db661 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fea681da 24.\"
f45a07b6
MK
25.\" 2007-10-23 mtk Added intro paragraph about section, plus a paragraph
26.\" about exit status values.
27.\"
a5b9e015 28.TH INTRO 1 2007-11-15 "Linux" "Linux User's Manual"
fea681da 29.SH NAME
f68512e9 30intro \- introduction to user commands
fea681da 31.SH DESCRIPTION
f45a07b6
MK
32Section 1 of the manual describes user commands and tools,
33for example, file manipulation tools, shells, compilers,
34web browsers, file and image viewers and editors, and so on.
35
36All commands yield a status value on termination.
37This value can be tested (e.g., in most shells the variable
38.I $?
39contains the status of the last executed command)
40to see whether the command completed successfully.
41A zero exit status is conventionally used to indicate success,
c7094399 42and a nonzero status means that the command was unsuccessful.
f45a07b6
MK
43(Details of the exit status can be found in
44.BR wait (2).)
c7094399
MK
45A nonzero exit status can be in the range 1 to 255, and some commands
46use different nonzero status values to indicate the reason why the
f45a07b6
MK
47command failed.
48.SH NOTES
008f1ecc
MK
49Linux is a flavor of UNIX, and as a first approximation
50all user commands under UNIX work precisely the same under
51Linux (and FreeBSD and lots of other UNIX-like systems).
fea681da 52.LP
eb9a0b2f 53Under Linux, there are GUIs (graphical user interfaces), where you
fea681da 54can point and click and drag, and hopefully get work done without
ca7b3c18 55first reading lots of documentation.
008f1ecc 56The traditional UNIX environment
fea681da 57is a CLI (command line interface), where you type commands to
ca7b3c18
MK
58tell the computer what to do.
59That is faster and more powerful,
fea681da
MK
60but requires finding out what the commands are.
61Below a bare minimum, to get started.
73d8cece 62.SS Login
6732bb8b
SA
63In order to start working, you probably first have to open a session by
64giving, your username and password.
fea681da 65The program
6732bb8b 66.BR login (1)
fea681da
MK
67now starts a
68.I shell
69(command interpreter) for you.
70In case of a graphical login, you get a screen with menus or icons
ca7b3c18
MK
71and a mouse click will start a shell in a window.
72See also
fea681da 73.BR xterm (1).
73d8cece 74.SS The shell
fea681da
MK
75One types commands to the
76.IR shell ,
ca7b3c18
MK
77the command interpreter.
78It is not built-in, but is just a program
79and you can change your shell.
80Everybody has her own favorite one.
fea681da
MK
81The standard one is called
82.IR sh .
83See also
84.BR ash (1),
85.BR bash (1),
6732bb8b 86.BR chsh (1),
fea681da 87.BR csh (1),
6732bb8b
SA
88.BR dash (1),
89.BR ksh (1),
90.BR zsh (1).
91.LP
92A session might go like:
fea681da 93.LP
fea681da
MK
94.RS
95.nf
d1f129d4
SA
96.RB "knuth login: " aeb
97.RB "Password: " ********
144685a7 98.RB "$ " date
fea681da 99Tue Aug 6 23:50:44 CEST 2002
144685a7 100.RB "$ " cal
fea681da 101 August 2002
988db661 102Su Mo Tu We Th Fr Sa
fea681da
MK
103 1 2 3
104 4 5 6 7 8 9 10
10511 12 13 14 15 16 17
10618 19 20 21 22 23 24
10725 26 27 28 29 30 31
108
144685a7 109.RB "$ " ls
fea681da 110bin tel
144685a7 111.RB "$ " "ls \-l"
fea681da 112total 2
94e9d9fe
MK
113drwxrwxr\-x 2 aeb 1024 Aug 6 23:51 bin
114\-rw\-rw\-r\-\- 1 aeb 37 Aug 6 23:52 tel
144685a7 115.RB "$ " "cat tel"
94e9d9fe
MK
116maja 0501\-1136285
117peter 0136\-7399214
144685a7
SA
118.RB "$ " "cp tel tel2"
119.RB "$ " "ls \-l"
fea681da 120total 3
94e9d9fe
MK
121drwxr\-xr\-x 2 aeb 1024 Aug 6 23:51 bin
122\-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:52 tel
123\-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:53 tel2
144685a7
SA
124.RB "$ " "mv tel tel1"
125.RB "$ " "ls \-l"
fea681da 126total 3
94e9d9fe
MK
127drwxr\-xr\-x 2 aeb 1024 Aug 6 23:51 bin
128\-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:52 tel1
129\-rw\-r\-\-r\-\- 1 aeb 37 Aug 6 23:53 tel2
144685a7
SA
130.RB "$ " "diff tel1 tel2"
131.RB "$ " "rm tel1"
132.RB "$ " "grep maja tel2"
94e9d9fe 133maja 0501\-1136285
144685a7 134$
fea681da
MK
135.fi
136.RE
6732bb8b 137.LP
fea681da 138The
144685a7 139.B $
5503c85e 140here was the command prompt\(emit is the shell's way of indicating
ca7b3c18
MK
141that it is ready for the next command.
142The prompt can be customized
18701562 143in lots of ways, and one might include stuff like username,
410f3d22 144machine name, current directory, time, and so on.
fea681da
MK
145An assignment PS1="What next, master? "
146would change the prompt as indicated.
147.LP
148We see that there are commands
149.I date
150(that gives date and time), and
151.I cal
152(that gives a calendar).
153.LP
154The command
155.I ls
5503c85e 156lists the contents of the current directory\(emit tells you what
ca7b3c18 157files you have.
80d26cef
MK
158With a
159.I \-l
160option it gives a long listing,
fea681da
MK
161that includes the owner and size and date of the file, and the
162permissions people have for reading and/or changing the file.
163For example, the file "tel" here is 37 bytes long, owned by aeb
164and the owner can read and write it, others can only read it.
165Owner and permissions can be changed by the commands
166.I chown
167and
168.IR chmod .
169.LP
170The command
171.I cat
172will show the contents of a file.
173(The name is from "concatenate and print": all files given as
6732bb8b
SA
174parameters are concatenated and sent to "standard output"
175(see
176.BR stdout (3)),
177here
fea681da
MK
178the terminal screen.)
179.LP
180The command
181.I cp
182(from "copy") will copy a file.
6732bb8b
SA
183.LP
184The command
fea681da 185.I mv
6732bb8b 186(from "move"), on the other hand, only renames it.
fea681da
MK
187.LP
188The command
189.I diff
190lists the differences between two files.
191Here there was no output because there were no differences.
192.LP
193The command
194.I rm
195(from "remove") deletes the file, and be careful! it is gone.
ca7b3c18
MK
196No wastepaper basket or anything.
197Deleted means lost.
fea681da
MK
198.LP
199The command
200.I grep
201(from "g/re/p") finds occurrences of a string in one or more files.
202Here it finds Maja's telephone number.
73d8cece 203.SS Pathnames and the current directory
fea681da
MK
204Files live in a large tree, the file hierarchy.
205Each has a
2d7195b8 206.I "pathname"
af2908c3
SA
207describing the path from the root of the tree (which is called
208.IR / )
ca7b3c18 209to the file.
af2908c3
SA
210For example, such a full pathname might be
211.IR /home/aeb/tel .
2d7195b8 212Always using full pathnames would be inconvenient, and the name
33a0ccb2
MK
213of a file in the current directory may be abbreviated by giving
214only the last component.
af2908c3
SA
215That is why
216.I /home/aeb/tel
217can be abbreviated
218to
219.I tel
220when the current directory is
221.IR /home/aeb .
fea681da
MK
222.LP
223The command
224.I pwd
225prints the current directory.
226.LP
227The command
228.I cd
229changes the current directory.
6732bb8b
SA
230.LP
231Try alternatively
232.I cd
233and
234.I pwd
235commands and explore
236.I cd
237usage: "cd", "cd .", "cd ..", "cd /" and "cd ~".
73d8cece 238.SS Directories
fea681da
MK
239The command
240.I mkdir
241makes a new directory.
242.LP
243The command
244.I rmdir
245removes a directory if it is empty, and complains otherwise.
246.LP
247The command
248.I find
249(with a rather baroque syntax) will find files with given name
20523df7
MK
250or other properties.
251For example, "find . \-name tel" would find
af2908c3
SA
252the file
253.I tel
254starting in the present directory (which is called
255.IR . ).
4d9b6984 256And "find / \-name tel" would do the same, but starting at the root
20523df7
MK
257of the tree.
258Large searches on a multi-GB disk will be time-consuming,
fea681da
MK
259and it may be better to use
260.BR locate (1).
73d8cece 261.SS Disks and filesystems
fea681da
MK
262The command
263.I mount
9ee4a2b6
MK
264will attach the filesystem found on some disk (or floppy, or CDROM or so)
265to the big filesystem hierarchy.
20523df7 266And
fea681da
MK
267.I umount
268detaches it again.
269The command
270.I df
271will tell you how much of your disk is still free.
73d8cece 272.SS Processes
008f1ecc 273On a UNIX system many user and system processes run simultaneously.
fea681da
MK
274The one you are talking to runs in the
275.IR foreground ,
276the others in the
277.IR background .
278The command
279.I ps
280will show you which processes are active and what numbers these
281processes have.
282The command
283.I kill
20523df7
MK
284allows you to get rid of them.
285Without option this is a friendly
286request: please go away.
287And "kill \-9" followed by the number
fea681da
MK
288of the process is an immediate kill.
289Foreground processes can often be killed by typing Control-C.
73d8cece 290.SS Getting information
fea681da
MK
291There are thousands of commands, each with many options.
292Traditionally commands are documented on
293.IR "man pages" ,
294(like this one), so that the command "man kill" will document
295the use of the command "kill" (and "man man" document the command "man").
296The program
297.I man
298sends the text through some
299.IR pager ,
300usually
301.IR less .
302Hit the space bar to get the next page, hit q to quit.
303.LP
9fdfa163 304In documentation it is customary to refer to man pages
fea681da
MK
305by giving the name and section number, as in
306.BR man (1).
307Man pages are terse, and allow you to find quickly some forgotten
20523df7
MK
308detail.
309For newcomers an introductory text with more examples
fea681da
MK
310and explanations is useful.
311.LP
20523df7
MK
312A lot of GNU/FSF software is provided with info files.
313Type "info info"
4ca1679e
SA
314for an introduction on the use of the program
315.IR info .
fea681da 316.LP
20523df7
MK
317Special topics are often treated in HOWTOs.
318Look in
fea681da
MK
319.I /usr/share/doc/howto/en
320and use a browser if you find HTML files there.
321.\"
322.\" Actual examples? Separate section for each of cat, cp, ...?
323.\" gzip, bzip2, tar, rpm
47297adb 324.SH SEE ALSO
ab946020 325.BR ash (1),
b35813db
SA
326.BR bash (1),
327.BR chsh (1),
ab946020 328.BR csh (1),
6732bb8b
SA
329.BR dash (1),
330.BR ksh (1),
ab946020 331.BR locate (1),
b35813db
SA
332.BR login (1),
333.BR man (1),
6732bb8b 334.BR su (1),
b35813db
SA
335.BR xterm (1),
336.BR zsh(1),
337.BR wait (2),
6732bb8b 338.BR stdout (3),
b35813db 339.BR man-pages (7),
6732bb8b
SA
340.BR standards (7),
341.BR shutdown (8)