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