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