477 lines
11 KiB
HTML
477 lines
11 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of INTRO</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>INTRO</H1>
|
|
Section: Linux User's Manual (1)<BR>Updated: 2015-07-23<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
intro - introduction to user commands
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
Section 1 of the manual describes user commands and tools,
|
|
for example, file manipulation tools, shells, compilers,
|
|
web browsers, file and image viewers and editors, and so on.
|
|
<A NAME="lbAD"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
Linux is a flavor of UNIX, and as a first approximation
|
|
all user commands under UNIX work precisely the same under
|
|
Linux (and FreeBSD and lots of other UNIX-like systems).
|
|
<P>
|
|
|
|
Under Linux, there are GUIs (graphical user interfaces), where you
|
|
can point and click and drag, and hopefully get work done without
|
|
first reading lots of documentation.
|
|
The traditional UNIX environment
|
|
is a CLI (command line interface), where you type commands to
|
|
tell the computer what to do.
|
|
That is faster and more powerful,
|
|
but requires finding out what the commands are.
|
|
Below a bare minimum, to get started.
|
|
<A NAME="lbAE"> </A>
|
|
<H3>Login</H3>
|
|
|
|
In order to start working, you probably first have to open a session by
|
|
giving your username and password.
|
|
The program
|
|
<B><A HREF="/cgi-bin/man/man2html?1+login">login</A></B>(1)
|
|
|
|
now starts a
|
|
<I>shell</I>
|
|
|
|
(command interpreter) for you.
|
|
In case of a graphical login, you get a screen with menus or icons
|
|
and a mouse click will start a shell in a window.
|
|
See also
|
|
<B><A HREF="/cgi-bin/man/man2html?1+xterm">xterm</A></B>(1).
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H3>The shell</H3>
|
|
|
|
One types commands to the
|
|
<I>shell</I>,
|
|
|
|
the command interpreter.
|
|
It is not built-in, but is just a program
|
|
and you can change your shell.
|
|
Everybody has their own favorite one.
|
|
The standard one is called
|
|
<I>sh</I>.
|
|
|
|
See also
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ash">ash</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+bash">bash</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+chsh">chsh</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+csh">csh</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+dash">dash</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ksh">ksh</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+zsh">zsh</A></B>(1).
|
|
|
|
<P>
|
|
|
|
A session might go like:
|
|
<P>
|
|
|
|
|
|
|
|
knuth login: <B>aeb</B>
|
|
|
|
Password: <B>********</B>
|
|
|
|
$ <B>date</B>
|
|
|
|
Tue Aug 6 23:50:44 CEST 2002
|
|
$ <B>cal</B>
|
|
|
|
<BR> August 2002
|
|
Su Mo Tu We Th Fr Sa
|
|
<BR> 1 2 3
|
|
<BR> 4 5 6 7 8 9 10
|
|
11 12 13 14 15 16 17
|
|
18 19 20 21 22 23 24
|
|
25 26 27 28 29 30 31
|
|
<P>
|
|
$ <B>ls</B>
|
|
|
|
bin tel
|
|
$ <B>ls -l</B>
|
|
|
|
total 2
|
|
drwxrwxr-x 2 aeb 1024 Aug 6 23:51 bin
|
|
-rw-rw-r-- 1 aeb 37 Aug 6 23:52 tel
|
|
$ <B>cat tel</B>
|
|
|
|
maja 0501-1136285
|
|
peter 0136-7399214
|
|
$ <B>cp tel tel2</B>
|
|
|
|
$ <B>ls -l</B>
|
|
|
|
total 3
|
|
drwxr-xr-x 2 aeb 1024 Aug 6 23:51 bin
|
|
-rw-r--r-- 1 aeb 37 Aug 6 23:52 tel
|
|
-rw-r--r-- 1 aeb 37 Aug 6 23:53 tel2
|
|
$ <B>mv tel tel1</B>
|
|
|
|
$ <B>ls -l</B>
|
|
|
|
total 3
|
|
drwxr-xr-x 2 aeb 1024 Aug 6 23:51 bin
|
|
-rw-r--r-- 1 aeb 37 Aug 6 23:52 tel1
|
|
-rw-r--r-- 1 aeb 37 Aug 6 23:53 tel2
|
|
$ <B>diff tel1 tel2</B>
|
|
|
|
$ <B>rm tel1</B>
|
|
|
|
$ <B>grep maja tel2</B>
|
|
|
|
maja 0501-1136285
|
|
$
|
|
|
|
|
|
<P>
|
|
|
|
Here typing Control-D ended the session.
|
|
<P>
|
|
|
|
The
|
|
<B>$</B>
|
|
|
|
here was the command prompt---it is the shell's way of indicating
|
|
that it is ready for the next command.
|
|
The prompt can be customized
|
|
in lots of ways, and one might include stuff like username,
|
|
machine name, current directory, time, and so on.
|
|
An assignment PS1="What next, master? "
|
|
would change the prompt as indicated.
|
|
<P>
|
|
|
|
We see that there are commands
|
|
<I>date</I>
|
|
|
|
(that gives date and time), and
|
|
<I>cal</I>
|
|
|
|
(that gives a calendar).
|
|
<P>
|
|
|
|
The command
|
|
<I>ls</I>
|
|
|
|
lists the contents of the current directory---it tells you what
|
|
files you have.
|
|
With a
|
|
<I>-l</I>
|
|
|
|
option it gives a long listing,
|
|
that includes the owner and size and date of the file, and the
|
|
permissions people have for reading and/or changing the file.
|
|
For example, the file "tel" here is 37 bytes long, owned by aeb
|
|
and the owner can read and write it, others can only read it.
|
|
Owner and permissions can be changed by the commands
|
|
<I>chown</I>
|
|
|
|
and
|
|
<I>chmod</I>.
|
|
|
|
<P>
|
|
|
|
The command
|
|
<I>cat</I>
|
|
|
|
will show the contents of a file.
|
|
(The name is from "concatenate and print": all files given as
|
|
parameters are concatenated and sent to "standard output"
|
|
(see
|
|
<B><A HREF="/cgi-bin/man/man2html?3+stdout">stdout</A></B>(3)),
|
|
|
|
here
|
|
the terminal screen.)
|
|
<P>
|
|
|
|
The command
|
|
<I>cp</I>
|
|
|
|
(from "copy") will copy a file.
|
|
<P>
|
|
|
|
The command
|
|
<I>mv</I>
|
|
|
|
(from "move"), on the other hand, only renames it.
|
|
<P>
|
|
|
|
The command
|
|
<I>diff</I>
|
|
|
|
lists the differences between two files.
|
|
Here there was no output because there were no differences.
|
|
<P>
|
|
|
|
The command
|
|
<I>rm</I>
|
|
|
|
(from "remove") deletes the file, and be careful! it is gone.
|
|
No wastepaper basket or anything.
|
|
Deleted means lost.
|
|
<P>
|
|
|
|
The command
|
|
<I>grep</I>
|
|
|
|
(from "g/re/p") finds occurrences of a string in one or more files.
|
|
Here it finds Maja's telephone number.
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Pathnames and the current directory</H3>
|
|
|
|
Files live in a large tree, the file hierarchy.
|
|
Each has a
|
|
<I>pathname</I>
|
|
|
|
describing the path from the root of the tree (which is called
|
|
<I>/</I>)
|
|
|
|
to the file.
|
|
For example, such a full pathname might be
|
|
<I>/home/aeb/tel</I>.
|
|
|
|
Always using full pathnames would be inconvenient, and the name
|
|
of a file in the current directory may be abbreviated by giving
|
|
only the last component.
|
|
That is why
|
|
<I>/home/aeb/tel</I>
|
|
|
|
can be abbreviated
|
|
to
|
|
<I>tel</I>
|
|
|
|
when the current directory is
|
|
<I>/home/aeb</I>.
|
|
|
|
<P>
|
|
|
|
The command
|
|
<I>pwd</I>
|
|
|
|
prints the current directory.
|
|
<P>
|
|
|
|
The command
|
|
<I>cd</I>
|
|
|
|
changes the current directory.
|
|
<P>
|
|
|
|
Try alternatively
|
|
<I>cd</I>
|
|
|
|
and
|
|
<I>pwd</I>
|
|
|
|
commands and explore
|
|
<I>cd</I>
|
|
|
|
usage: "cd", "cd .", "cd ..", "cd /" and "cd ~".
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Directories</H3>
|
|
|
|
The command
|
|
<I>mkdir</I>
|
|
|
|
makes a new directory.
|
|
<P>
|
|
|
|
The command
|
|
<I>rmdir</I>
|
|
|
|
removes a directory if it is empty, and complains otherwise.
|
|
<P>
|
|
|
|
The command
|
|
<I>find</I>
|
|
|
|
(with a rather baroque syntax) will find files with given name
|
|
or other properties.
|
|
For example, "find . -name tel" would find
|
|
the file
|
|
<I>tel</I>
|
|
|
|
starting in the present directory (which is called
|
|
<I>.</I>).
|
|
|
|
And "find / -name tel" would do the same, but starting at the root
|
|
of the tree.
|
|
Large searches on a multi-GB disk will be time-consuming,
|
|
and it may be better to use
|
|
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(1).
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H3>Disks and filesystems</H3>
|
|
|
|
The command
|
|
<I>mount</I>
|
|
|
|
will attach the filesystem found on some disk (or floppy, or CDROM or so)
|
|
to the big filesystem hierarchy.
|
|
And
|
|
<I>umount</I>
|
|
|
|
detaches it again.
|
|
The command
|
|
<I>df</I>
|
|
|
|
will tell you how much of your disk is still free.
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Processes</H3>
|
|
|
|
On a UNIX system many user and system processes run simultaneously.
|
|
The one you are talking to runs in the
|
|
<I>foreground</I>,
|
|
|
|
the others in the
|
|
<I>background</I>.
|
|
|
|
The command
|
|
<I>ps</I>
|
|
|
|
will show you which processes are active and what numbers these
|
|
processes have.
|
|
The command
|
|
<I>kill</I>
|
|
|
|
allows you to get rid of them.
|
|
Without option this is a friendly
|
|
request: please go away.
|
|
And "kill -9" followed by the number
|
|
of the process is an immediate kill.
|
|
Foreground processes can often be killed by typing Control-C.
|
|
<A NAME="lbAK"> </A>
|
|
<H3>Getting information</H3>
|
|
|
|
There are thousands of commands, each with many options.
|
|
Traditionally commands are documented on
|
|
<I>man pages</I>,
|
|
|
|
(like this one), so that the command "man kill" will document
|
|
the use of the command "kill" (and "man man" document the command "man").
|
|
The program
|
|
<I>man</I>
|
|
|
|
sends the text through some
|
|
<I>pager</I>,
|
|
|
|
usually
|
|
<I>less</I>.
|
|
|
|
Hit the space bar to get the next page, hit q to quit.
|
|
<P>
|
|
|
|
In documentation it is customary to refer to man pages
|
|
by giving the name and section number, as in
|
|
<B><A HREF="/cgi-bin/man/man2html?1+man">man</A></B>(1).
|
|
|
|
Man pages are terse, and allow you to find quickly some forgotten
|
|
detail.
|
|
For newcomers an introductory text with more examples
|
|
and explanations is useful.
|
|
<P>
|
|
|
|
A lot of GNU/FSF software is provided with info files.
|
|
Type "info info"
|
|
for an introduction on the use of the program
|
|
<I>info</I>.
|
|
|
|
<P>
|
|
|
|
Special topics are often treated in HOWTOs.
|
|
Look in
|
|
<I>/usr/share/doc/howto/en</I>
|
|
|
|
and use a browser if you find HTML files there.
|
|
|
|
|
|
|
|
<A NAME="lbAL"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ash">ash</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+bash">bash</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+chsh">chsh</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+csh">csh</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+dash">dash</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ksh">ksh</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+locate">locate</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+login">login</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+man">man</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+xterm">xterm</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+zsh">zsh</A></B>(1),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+wait">wait</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+stdout">stdout</A></B>(3),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+man-pages">man-pages</A></B>(7),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+standards">standards</A></B>(7)
|
|
|
|
<A NAME="lbAM"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">NOTES</A><DD>
|
|
<DL>
|
|
<DT id="4"><A HREF="#lbAE">Login</A><DD>
|
|
<DT id="5"><A HREF="#lbAF">The shell</A><DD>
|
|
<DT id="6"><A HREF="#lbAG">Pathnames and the current directory</A><DD>
|
|
<DT id="7"><A HREF="#lbAH">Directories</A><DD>
|
|
<DT id="8"><A HREF="#lbAI">Disks and filesystems</A><DD>
|
|
<DT id="9"><A HREF="#lbAJ">Processes</A><DD>
|
|
<DT id="10"><A HREF="#lbAK">Getting information</A><DD>
|
|
</DL>
|
|
<DT id="11"><A HREF="#lbAL">SEE ALSO</A><DD>
|
|
<DT id="12"><A HREF="#lbAM">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:17 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|