]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man1/intro.1
Many pages: Use \[ti] instead of \(ti
[thirdparty/man-pages.git] / man1 / intro.1
1 .\" Copyright (c) 2002 Andries Brouwer <aeb@cwi.nl>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH intro 1 (date) "Linux man-pages (unreleased)"
6 .SH NAME
7 intro \- introduction to user commands
8 .SH DESCRIPTION
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.
12 .SH NOTES
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).
16 .PP
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.
26 .SS Login
27 In order to start working, you probably first have to open a session by
28 giving your username and password.
29 The program
30 .BR login (1)
31 now starts a
32 .I shell
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.
36 See also
37 .BR xterm (1).
38 .SS The shell
39 One types commands to the
40 .IR shell ,
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
46 .IR sh .
47 See also
48 .BR ash (1),
49 .BR bash (1),
50 .BR chsh (1),
51 .BR csh (1),
52 .BR dash (1),
53 .BR ksh (1),
54 .BR zsh (1).
55 .PP
56 A session might go like:
57 .PP
58 .in +4n
59 .EX
60 .RB "knuth login: " aeb
61 .RB "Password: " ********
62 .RB "$ " date
63 Tue Aug 6 23:50:44 CEST 2002
64 .RB "$ " cal
65 August 2002
66 Su Mo Tu We Th Fr Sa
67 1 2 3
68 4 5 6 7 8 9 10
69 11 12 13 14 15 16 17
70 18 19 20 21 22 23 24
71 25 26 27 28 29 30 31
72
73 .RB "$ " ls
74 bin tel
75 .RB "$ " "ls \-l"
76 total 2
77 drwxrwxr\-x 2 aeb 1024 Aug 6 23:51 bin
78 \-rw\-rw\-r\-\- 1 aeb 37 Aug 6 23:52 tel
79 .RB "$ " "cat tel"
80 maja 0501\-1136285
81 peter 0136\-7399214
82 .RB "$ " "cp tel tel2"
83 .RB "$ " "ls \-l"
84 total 3
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"
89 .RB "$ " "ls \-l"
90 total 3
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"
95 .RB "$ " "rm tel1"
96 .RB "$ " "grep maja tel2"
97 maja 0501\-1136285
98 $
99 .EE
100 .in
101 .PP
102 Here typing Control-D ended the session.
103 .PP
104 The
105 .B $
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.
113 .PP
114 We see that there are commands
115 .I date
116 (that gives date and time), and
117 .I cal
118 (that gives a calendar).
119 .PP
120 The command
121 .I ls
122 lists the contents of the current directory\[em]it tells you what
123 files you have.
124 With a
125 .I \-l
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
132 .I chown
133 and
134 .IR chmod .
135 .PP
136 The command
137 .I cat
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"
141 (see
142 .BR stdout (3)),
143 here
144 the terminal screen.)
145 .PP
146 The command
147 .I cp
148 (from "copy") will copy a file.
149 .PP
150 The command
151 .I mv
152 (from "move"), on the other hand, only renames it.
153 .PP
154 The command
155 .I diff
156 lists the differences between two files.
157 Here there was no output because there were no differences.
158 .PP
159 The command
160 .I rm
161 (from "remove") deletes the file, and be careful! it is gone.
162 No wastepaper basket or anything.
163 Deleted means lost.
164 .PP
165 The command
166 .I grep
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.
171 Each has a
172 .I "pathname"
173 describing the path from the root of the tree (which is called
174 .IR / )
175 to the file.
176 For example, such a full pathname might be
177 .IR /home/aeb/tel .
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.
181 That is why
182 .I /home/aeb/tel
183 can be abbreviated
184 to
185 .I tel
186 when the current directory is
187 .IR /home/aeb .
188 .PP
189 The command
190 .I pwd
191 prints the current directory.
192 .PP
193 The command
194 .I cd
195 changes the current directory.
196 .PP
197 Try alternatively
198 .I cd
199 and
200 .I pwd
201 commands and explore
202 .I cd
203 usage: "cd", "cd .", "cd ..", "cd /", and "cd \[ti]".
204 .SS Directories
205 The command
206 .I mkdir
207 makes a new directory.
208 .PP
209 The command
210 .I rmdir
211 removes a directory if it is empty, and complains otherwise.
212 .PP
213 The command
214 .I find
215 (with a rather baroque syntax) will find files with given name
216 or other properties.
217 For example, "find . \-name tel" would find
218 the file
219 .I tel
220 starting in the present directory (which is called
221 .IR . ).
222 And "find / \-name tel" would do the same, but starting at the root
223 of the tree.
224 Large searches on a multi-GB disk will be time-consuming,
225 and it may be better to use
226 .BR locate (1).
227 .SS Disks and filesystems
228 The command
229 .I mount
230 will attach the filesystem found on some disk (or floppy, or CDROM or so)
231 to the big filesystem hierarchy.
232 And
233 .I umount
234 detaches it again.
235 The command
236 .I df
237 will tell you how much of your disk is still free.
238 .SS Processes
239 On a UNIX system many user and system processes run simultaneously.
240 The one you are talking to runs in the
241 .IR foreground ,
242 the others in the
243 .IR background .
244 The command
245 .I ps
246 will show you which processes are active and what numbers these
247 processes have.
248 The command
249 .I kill
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
259 .IR "man pages" ,
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").
262 The program
263 .I man
264 sends the text through some
265 .IR pager ,
266 usually
267 .IR less .
268 Hit the space bar to get the next page, hit q to quit.
269 .PP
270 In documentation it is customary to refer to man pages
271 by giving the name and section number, as in
272 .BR man (1).
273 Man pages are terse, and allow you to find quickly some forgotten
274 detail.
275 For newcomers an introductory text with more examples
276 and explanations is useful.
277 .PP
278 A lot of GNU/FSF software is provided with info files.
279 Type "info info"
280 for an introduction on the use of the program
281 .IR info .
282 .PP
283 Special topics are often treated in HOWTOs.
284 Look in
285 .I /usr/share/doc/howto/en
286 and use a browser if you find HTML files there.
287 .\"
288 .\" Actual examples? Separate section for each of cat, cp, ...?
289 .\" gzip, bzip2, tar, rpm
290 .SH SEE ALSO
291 .BR ash (1),
292 .BR bash (1),
293 .BR chsh (1),
294 .BR csh (1),
295 .BR dash (1),
296 .BR ksh (1),
297 .BR locate (1),
298 .BR login (1),
299 .BR man (1),
300 .BR xterm (1),
301 .BR zsh (1),
302 .BR wait (2),
303 .BR stdout (3),
304 .BR man\-pages (7),
305 .BR standards (7)