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