Debian Codegraph @

upstream/debian-trixie/man1/intro.1

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