]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man1/intro.1
Wrapped source lines at sentence boundaries.
[thirdparty/man-pages.git] / man1 / intro.1
1 .\" Copyright (c) 2002 Andries Brouwer <aeb@cwi.nl>
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .TH INTRO 1 2002-08-06 "Linux" "Linux User's Manual"
24 .SH NAME
25 intro \- Introduction to user commands
26 .SH DESCRIPTION
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).
30 .LP
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.
40 .SS "Login"
41 In order to start working, you probably first have to login,
42 that is, give your username and password.
43 See also
44 .BR login (1).
45 The program
46 .I login
47 now starts a
48 .I shell
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.
52 See also
53 .BR xterm (1).
54 .SS "The shell"
55 One types commands to the
56 .IR shell ,
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
62 .IR sh .
63 See also
64 .BR ash (1),
65 .BR bash (1),
66 .BR csh (1),
67 .BR zsh (1),
68 .BR chsh (1).
69 .LP
70 A session might go like
71
72 .RS
73 .nf
74 .BI "knuth login: " aeb
75 .BI "Password: " ********
76 .BI "% " date
77 Tue Aug 6 23:50:44 CEST 2002
78 .BI "% " cal
79 August 2002
80 Su Mo Tu We Th Fr Sa
81 1 2 3
82 4 5 6 7 8 9 10
83 11 12 13 14 15 16 17
84 18 19 20 21 22 23 24
85 25 26 27 28 29 30 31
86
87 .BI "% " ls
88 bin tel
89 .BI "% " "ls \-l"
90 total 2
91 drwxrwxr-x 2 aeb 1024 Aug 6 23:51 bin
92 -rw-rw-r-- 1 aeb 37 Aug 6 23:52 tel
93 .BI "% " "cat tel"
94 maja 0501-1136285
95 peter 0136-7399214
96 .BI "% " "cp tel tel2"
97 .BI "% " "ls \-l"
98 total 3
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"
103 .BI "% " "ls \-l"
104 total 3
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"
109 .BI "% " "rm tel1"
110 .BI "% " "grep maja tel2"
111 maja 0501-1136285
112 .BI "% "
113 .fi
114 .RE
115 and here typing Control-D ended the session.
116 The
117 .B "% "
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.
125 .LP
126 We see that there are commands
127 .I date
128 (that gives date and time), and
129 .I cal
130 (that gives a calendar).
131 .LP
132 The command
133 .I ls
134 lists the contents of the current directory \(em it tells you what
135 files you have.
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
142 .I chown
143 and
144 .IR chmod .
145 .LP
146 The command
147 .I cat
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.)
152 .LP
153 The command
154 .I cp
155 (from "copy") will copy a file.
156 On the other hand, the command
157 .I mv
158 (from "move") only renames it.
159 .LP
160 The command
161 .I diff
162 lists the differences between two files.
163 Here there was no output because there were no differences.
164 .LP
165 The command
166 .I rm
167 (from "remove") deletes the file, and be careful! it is gone.
168 No wastepaper basket or anything.
169 Deleted means lost.
170 .LP
171 The command
172 .I grep
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.
177 Each has a
178 .I "pathname"
179 describing the path from the root of the tree (which is called /)
180 to the file.
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
184 the last component.
185 That is why "/home/aeb/tel" can be abbreviated
186 to "tel" when the current directory is "/home/aeb".
187 .LP
188 The command
189 .I pwd
190 prints the current directory.
191 .LP
192 The command
193 .I cd
194 changes the current directory.
195 Try "cd /" and "pwd" and "cd" and "pwd".
196 .SS "Directories"
197 The command
198 .I mkdir
199 makes a new directory.
200 .LP
201 The command
202 .I rmdir
203 removes a directory if it is empty, and complains otherwise.
204 .LP
205 The command
206 .I find
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
213 .BR locate (1).
214 .SS "Disks and Filesystems"
215 The command
216 .I mount
217 will attach the filesystem found on some disk (or floppy, or CDROM or so)
218 to the big filesystem hierarchy. And
219 .I umount
220 detaches it again.
221 The command
222 .I df
223 will tell you how much of your disk is still free.
224 .SS "Processes"
225 On a Unix system many user and system processes run simultaneously.
226 The one you are talking to runs in the
227 .IR foreground ,
228 the others in the
229 .IR background .
230 The command
231 .I ps
232 will show you which processes are active and what numbers these
233 processes have.
234 The command
235 .I kill
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
243 .IR "man pages" ,
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").
246 The program
247 .I man
248 sends the text through some
249 .IR pager ,
250 usually
251 .IR less .
252 Hit the space bar to get the next page, hit q to quit.
253 .LP
254 In documentation it is customary to refer to man pages
255 by giving the name and section number, as in
256 .BR man (1).
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.
260 .LP
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".
263 .LP
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.
267 .\"
268 .\" Actual examples? Separate section for each of cat, cp, ...?
269 .\" gzip, bzip2, tar, rpm
270 .SH "SEE ALSO"
271 .BR standards (7)