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