2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright (c) 2002 Andries Brouwer <aeb@cwi.nl>
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
2007-06-21 22:55:04 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
2007-06-21 22:55:04 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
2007-10-23 14:48:10 +00:00
|
|
|
.\" 2007-10-23 mtk Added intro paragraph about section, plus a paragraph
|
|
|
|
.\" about exit status values.
|
|
|
|
.\"
|
2007-11-15 03:21:33 +00:00
|
|
|
.TH INTRO 1 2007-11-15 "Linux" "Linux User's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
intro \- Introduction to user commands
|
|
|
|
.SH DESCRIPTION
|
2007-10-23 14:48:10 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
All commands yield a status value on termination.
|
|
|
|
This value can be tested (e.g., in most shells the variable
|
|
|
|
.I $?
|
|
|
|
contains the status of the last executed command)
|
|
|
|
to see whether the command completed successfully.
|
|
|
|
A zero exit status is conventionally used to indicate success,
|
intro.1, time.1, adjtimex.2, capget.2, eventfd.2, fcntl.2, getrlimit.2, getsockopt.2, gettimeofday.2, intro.2, ioctl_list.2, ioperm.2, mlock.2, pivot_root.2, poll.2, prctl.2, ptrace.2, sched_setscheduler.2, select_tut.2, semget.2, sigaltstack.2, signalfd.2, sysctl.2, timer_settime.2, timerfd_create.2, wait.2, CPU_SET.3, argz_add.3, assert_perror.3, atexit.3, backtrace.3, bcmp.3, clearenv.3, ctime.3, dl_iterate_phdr.3, dlopen.3, ecvt.3, errno.3, error.3, ether_aton.3, exit.3, fenv.3, ferror.3, finite.3, flockfile.3, fnmatch.3, fpathconf.3, fpclassify.3, ftime.3, ftok.3, ftw.3, fwide.3, getaddrinfo.3, gethostbyname.3, getlogin.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getrpcent.3, getservent.3, glob.3, hsearch.3, inet.3, isalpha.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, longjmp.3, lsearch.3, malloc.3, matherr.3, mblen.3, mbsinit.3, mbtowc.3, on_exit.3, printf.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_equal.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setschedparam.3, pthread_setschedprio.3, ptsname.3, putenv.3, putgrent.3, raise.3, rcmd.3, regex.3, rexec.3, rpc.3, rpmatch.3, rtnetlink.3, scandir.3, sem_init.3, setaliasent.3, setbuf.3, setenv.3, setjmp.3, signbit.3, stdio_ext.3, strtod.3, strtol.3, strtoul.3, system.3, termios.3, timeradd.3, tzset.3, ualarm.3, wctomb.3, xdr.3, st.4, tty_ioctl.4, core.5, elf.5, proc.5, bootparam.7, capabilities.7, icmp.7, ip.7, ipv6.7, math_error.7, mdoc.samples.7, mq_overview.7, pthreads.7, raw.7, regex.7, socket.7, tcp.7, tzselect.8: Global fix: s/non-zero/nonzero/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:40:55 +00:00
|
|
|
and a nonzero status means that the command was unsuccessful.
|
2007-10-23 14:48:10 +00:00
|
|
|
(Details of the exit status can be found in
|
|
|
|
.BR wait (2).)
|
intro.1, time.1, adjtimex.2, capget.2, eventfd.2, fcntl.2, getrlimit.2, getsockopt.2, gettimeofday.2, intro.2, ioctl_list.2, ioperm.2, mlock.2, pivot_root.2, poll.2, prctl.2, ptrace.2, sched_setscheduler.2, select_tut.2, semget.2, sigaltstack.2, signalfd.2, sysctl.2, timer_settime.2, timerfd_create.2, wait.2, CPU_SET.3, argz_add.3, assert_perror.3, atexit.3, backtrace.3, bcmp.3, clearenv.3, ctime.3, dl_iterate_phdr.3, dlopen.3, ecvt.3, errno.3, error.3, ether_aton.3, exit.3, fenv.3, ferror.3, finite.3, flockfile.3, fnmatch.3, fpathconf.3, fpclassify.3, ftime.3, ftok.3, ftw.3, fwide.3, getaddrinfo.3, gethostbyname.3, getlogin.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getrpcent.3, getservent.3, glob.3, hsearch.3, inet.3, isalpha.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, longjmp.3, lsearch.3, malloc.3, matherr.3, mblen.3, mbsinit.3, mbtowc.3, on_exit.3, printf.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_equal.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setschedparam.3, pthread_setschedprio.3, ptsname.3, putenv.3, putgrent.3, raise.3, rcmd.3, regex.3, rexec.3, rpc.3, rpmatch.3, rtnetlink.3, scandir.3, sem_init.3, setaliasent.3, setbuf.3, setenv.3, setjmp.3, signbit.3, stdio_ext.3, strtod.3, strtol.3, strtoul.3, system.3, termios.3, timeradd.3, tzset.3, ualarm.3, wctomb.3, xdr.3, st.4, tty_ioctl.4, core.5, elf.5, proc.5, bootparam.7, capabilities.7, icmp.7, ip.7, ipv6.7, math_error.7, mdoc.samples.7, mq_overview.7, pthreads.7, raw.7, regex.7, socket.7, tcp.7, tzselect.8: Global fix: s/non-zero/nonzero/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:40:55 +00:00
|
|
|
A nonzero exit status can be in the range 1 to 255, and some commands
|
|
|
|
use different nonzero status values to indicate the reason why the
|
2007-10-23 14:48:10 +00:00
|
|
|
command failed.
|
|
|
|
.SH NOTES
|
intro.1, time.1, accept.2, bind.2, connect.2, execve.2, flock.2, getdents.2, getpriority.2, getuid.2, intro.2, ioctl.2, mincore.2, mknod.2, personality.2, ptrace.2, read.2, recv.2, select_tut.2, send.2, sendfile.2, shmctl.2, sigaction.2, signal.2, stat.2, times.2, truncate.2, umask.2, wait.2, MB_CUR_MAX.3, MB_LEN_MAX.3, argz_add.3, btowc.3, clearenv.3, clock.3, cmsg.3, end.3, endian.3, errno.3, exit.3, fgetwc.3, fgetws.3, fopen.3, fputwc.3, fputws.3, fseek.3, fwide.3, getfsent.3, getgrnam.3, gethostid.3, getipnodebyname.3, getmntent.3, getpwnam.3, getwchar.3, grantpt.3, iconv.3, iconv_close.3, iconv_open.3, insque.3, intro.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, malloc.3, mblen.3, mbrlen.3, mbrtowc.3, mbsinit.3, mbsnrtowcs.3, mbsrtowcs.3, mbstowcs.3, mbtowc.3, mkstemp.3, mktemp.3, nl_langinfo.3, openpty.3, posix_openpt.3, printf.3, ptsname.3, putwchar.3, qecvt.3, rcmd.3, readdir.3, rexec.3, rpc.3, setnetgrent.3, shm_open.3, sigpause.3, stdin.3, stpcpy.3, strftime.3, strptime.3, syslog.3, towctrans.3, towlower.3, towupper.3, ttyslot.3, ungetwc.3, unlocked_stdio.3, wcpcpy.3, wcpncpy.3, wcrtomb.3, wcscasecmp.3, wcscat.3, wcschr.3, wcscmp.3, wcscpy.3, wcscspn.3, wcsdup.3, wcslen.3, wcsncasecmp.3, wcsncat.3, wcsncmp.3, wcsncpy.3, wcsnlen.3, wcsnrtombs.3, wcspbrk.3, wcsrchr.3, wcsrtombs.3, wcsspn.3, wcsstr.3, wcstok.3, wcstombs.3, wcswidth.3, wctob.3, wctomb.3, wctrans.3, wctype.3, wcwidth.3, wmemchr.3, wmemcmp.3, wmemcpy.3, wmemmove.3, wmemset.3, wprintf.3, console_ioctl.4, pts.4, elf.5, filesystems.5, hosts.5, proc.5, ttytype.5, boot.7, capabilities.7, credentials.7, epoll.7, glob.7, koi8-r.7, path_resolution.7, pty.7, signal.7, suffixes.7, time.7, unicode.7, unix.7, uri.7, utf-8.7: global fix: s/Unix/UNIX/
The man pages were rather inconsistent in the use of "Unix"
versus "UNIX". Let's go with the trademark usage.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-12 04:45:38 +00:00
|
|
|
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).
|
2004-11-03 13:51:07 +00:00
|
|
|
.LP
|
|
|
|
Under Linux there are GUIs (graphical user interfaces), where you
|
|
|
|
can point and click and drag, and hopefully get work done without
|
2007-06-08 11:25:04 +00:00
|
|
|
first reading lots of documentation.
|
intro.1, time.1, accept.2, bind.2, connect.2, execve.2, flock.2, getdents.2, getpriority.2, getuid.2, intro.2, ioctl.2, mincore.2, mknod.2, personality.2, ptrace.2, read.2, recv.2, select_tut.2, send.2, sendfile.2, shmctl.2, sigaction.2, signal.2, stat.2, times.2, truncate.2, umask.2, wait.2, MB_CUR_MAX.3, MB_LEN_MAX.3, argz_add.3, btowc.3, clearenv.3, clock.3, cmsg.3, end.3, endian.3, errno.3, exit.3, fgetwc.3, fgetws.3, fopen.3, fputwc.3, fputws.3, fseek.3, fwide.3, getfsent.3, getgrnam.3, gethostid.3, getipnodebyname.3, getmntent.3, getpwnam.3, getwchar.3, grantpt.3, iconv.3, iconv_close.3, iconv_open.3, insque.3, intro.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, malloc.3, mblen.3, mbrlen.3, mbrtowc.3, mbsinit.3, mbsnrtowcs.3, mbsrtowcs.3, mbstowcs.3, mbtowc.3, mkstemp.3, mktemp.3, nl_langinfo.3, openpty.3, posix_openpt.3, printf.3, ptsname.3, putwchar.3, qecvt.3, rcmd.3, readdir.3, rexec.3, rpc.3, setnetgrent.3, shm_open.3, sigpause.3, stdin.3, stpcpy.3, strftime.3, strptime.3, syslog.3, towctrans.3, towlower.3, towupper.3, ttyslot.3, ungetwc.3, unlocked_stdio.3, wcpcpy.3, wcpncpy.3, wcrtomb.3, wcscasecmp.3, wcscat.3, wcschr.3, wcscmp.3, wcscpy.3, wcscspn.3, wcsdup.3, wcslen.3, wcsncasecmp.3, wcsncat.3, wcsncmp.3, wcsncpy.3, wcsnlen.3, wcsnrtombs.3, wcspbrk.3, wcsrchr.3, wcsrtombs.3, wcsspn.3, wcsstr.3, wcstok.3, wcstombs.3, wcswidth.3, wctob.3, wctomb.3, wctrans.3, wctype.3, wcwidth.3, wmemchr.3, wmemcmp.3, wmemcpy.3, wmemmove.3, wmemset.3, wprintf.3, console_ioctl.4, pts.4, elf.5, filesystems.5, hosts.5, proc.5, ttytype.5, boot.7, capabilities.7, credentials.7, epoll.7, glob.7, koi8-r.7, path_resolution.7, pty.7, signal.7, suffixes.7, time.7, unicode.7, unix.7, uri.7, utf-8.7: global fix: s/Unix/UNIX/
The man pages were rather inconsistent in the use of "Unix"
versus "UNIX". Let's go with the trademark usage.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-12 04:45:38 +00:00
|
|
|
The traditional UNIX environment
|
2004-11-03 13:51:07 +00:00
|
|
|
is a CLI (command line interface), where you type commands to
|
2007-06-08 11:25:04 +00:00
|
|
|
tell the computer what to do.
|
|
|
|
That is faster and more powerful,
|
2004-11-03 13:51:07 +00:00
|
|
|
but requires finding out what the commands are.
|
|
|
|
Below a bare minimum, to get started.
|
|
|
|
.SS "Login"
|
|
|
|
In order to start working, you probably first have to login,
|
2007-06-08 11:25:04 +00:00
|
|
|
that is, give your username and password.
|
|
|
|
See also
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR login (1).
|
|
|
|
The program
|
|
|
|
.I login
|
|
|
|
now starts a
|
|
|
|
.I shell
|
|
|
|
(command interpreter) for you.
|
|
|
|
In case of a graphical login, you get a screen with menus or icons
|
2007-06-08 11:25:04 +00:00
|
|
|
and a mouse click will start a shell in a window.
|
|
|
|
See also
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR xterm (1).
|
|
|
|
.SS "The shell"
|
|
|
|
One types commands to the
|
|
|
|
.IR shell ,
|
2007-06-08 11:25:04 +00:00
|
|
|
the command interpreter.
|
|
|
|
It is not built-in, but is just a program
|
|
|
|
and you can change your shell.
|
|
|
|
Everybody has her own favorite one.
|
2004-11-03 13:51:07 +00:00
|
|
|
The standard one is called
|
|
|
|
.IR sh .
|
|
|
|
See also
|
|
|
|
.BR ash (1),
|
|
|
|
.BR bash (1),
|
|
|
|
.BR csh (1),
|
|
|
|
.BR zsh (1),
|
|
|
|
.BR chsh (1).
|
|
|
|
.LP
|
|
|
|
A session might go like
|
|
|
|
|
|
|
|
.RS
|
|
|
|
.nf
|
|
|
|
.BI "knuth login: " aeb
|
|
|
|
.BI "Password: " ********
|
|
|
|
.BI "% " date
|
|
|
|
Tue Aug 6 23:50:44 CEST 2002
|
|
|
|
.BI "% " cal
|
|
|
|
August 2002
|
2007-06-21 22:55:04 +00:00
|
|
|
Su Mo Tu We Th Fr Sa
|
2004-11-03 13:51:07 +00:00
|
|
|
1 2 3
|
|
|
|
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
|
|
|
|
|
|
|
|
.BI "% " ls
|
|
|
|
bin tel
|
2005-07-06 12:57:38 +00:00
|
|
|
.BI "% " "ls \-l"
|
2004-11-03 13:51:07 +00:00
|
|
|
total 2
|
2007-12-22 16:40:46 +00:00
|
|
|
drwxrwxr\-x 2 aeb 1024 Aug 6 23:51 bin
|
|
|
|
\-rw\-rw\-r\-\- 1 aeb 37 Aug 6 23:52 tel
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "% " "cat tel"
|
2007-12-22 16:40:46 +00:00
|
|
|
maja 0501\-1136285
|
|
|
|
peter 0136\-7399214
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "% " "cp tel tel2"
|
2005-07-06 12:57:38 +00:00
|
|
|
.BI "% " "ls \-l"
|
2004-11-03 13:51:07 +00:00
|
|
|
total 3
|
2007-12-22 16:40:46 +00:00
|
|
|
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
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "% " "mv tel tel1"
|
2005-07-06 12:57:38 +00:00
|
|
|
.BI "% " "ls \-l"
|
2004-11-03 13:51:07 +00:00
|
|
|
total 3
|
2007-12-22 16:40:46 +00:00
|
|
|
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
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "% " "diff tel1 tel2"
|
|
|
|
.BI "% " "rm tel1"
|
|
|
|
.BI "% " "grep maja tel2"
|
2007-12-22 16:40:46 +00:00
|
|
|
maja 0501\-1136285
|
2007-09-20 16:26:31 +00:00
|
|
|
.B "% "
|
2004-11-03 13:51:07 +00:00
|
|
|
.fi
|
|
|
|
.RE
|
|
|
|
and here typing Control-D ended the session.
|
|
|
|
The
|
|
|
|
.B "% "
|
2005-07-06 07:41:37 +00:00
|
|
|
here was the command prompt \(em it is the shell's way of indicating
|
2007-06-08 11:25:04 +00:00
|
|
|
that it is ready for the next command.
|
|
|
|
The prompt can be customized
|
2008-06-30 14:36:59 +00:00
|
|
|
in lots of ways, and one might include stuff like username,
|
2004-11-03 13:51:07 +00:00
|
|
|
machine name, current directory, time, etc.
|
|
|
|
An assignment PS1="What next, master? "
|
|
|
|
would change the prompt as indicated.
|
|
|
|
.LP
|
|
|
|
We see that there are commands
|
|
|
|
.I date
|
|
|
|
(that gives date and time), and
|
|
|
|
.I cal
|
|
|
|
(that gives a calendar).
|
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I ls
|
2005-07-06 07:41:37 +00:00
|
|
|
lists the contents of the current directory \(em it tells you what
|
2007-06-08 11:25:04 +00:00
|
|
|
files you have.
|
2008-06-26 13:28:19 +00:00
|
|
|
With a
|
|
|
|
.I \-l
|
|
|
|
option it gives a long listing,
|
2004-11-03 13:51:07 +00:00
|
|
|
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
|
|
|
|
and
|
|
|
|
.IR chmod .
|
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I cat
|
|
|
|
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", here
|
|
|
|
the terminal screen.)
|
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I cp
|
|
|
|
(from "copy") will copy a file.
|
|
|
|
On the other hand, the command
|
|
|
|
.I mv
|
|
|
|
(from "move") only renames it.
|
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I diff
|
|
|
|
lists the differences between two files.
|
|
|
|
Here there was no output because there were no differences.
|
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I rm
|
|
|
|
(from "remove") deletes the file, and be careful! it is gone.
|
2007-06-08 11:25:04 +00:00
|
|
|
No wastepaper basket or anything.
|
|
|
|
Deleted means lost.
|
2004-11-03 13:51:07 +00:00
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I grep
|
|
|
|
(from "g/re/p") finds occurrences of a string in one or more files.
|
|
|
|
Here it finds Maja's telephone number.
|
2006-02-12 22:19:08 +00:00
|
|
|
.SS "Pathnames and the current directory"
|
2004-11-03 13:51:07 +00:00
|
|
|
Files live in a large tree, the file hierarchy.
|
|
|
|
Each has a
|
2006-02-12 22:19:08 +00:00
|
|
|
.I "pathname"
|
2004-11-03 13:51:07 +00:00
|
|
|
describing the path from the root of the tree (which is called /)
|
2007-06-08 11:25:04 +00:00
|
|
|
to the file.
|
|
|
|
For example, such a full pathname might be /home/aeb/tel.
|
2006-02-12 22:19:08 +00:00
|
|
|
Always using full pathnames would be inconvenient, and the name
|
2004-11-03 13:51:07 +00:00
|
|
|
of a file in the current directory may be abbreviated by only giving
|
2007-06-08 11:25:04 +00:00
|
|
|
the last component.
|
|
|
|
That is why "/home/aeb/tel" can be abbreviated
|
2004-11-03 13:51:07 +00:00
|
|
|
to "tel" when the current directory is "/home/aeb".
|
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I pwd
|
|
|
|
prints the current directory.
|
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I cd
|
|
|
|
changes the current directory.
|
|
|
|
Try "cd /" and "pwd" and "cd" and "pwd".
|
|
|
|
.SS "Directories"
|
|
|
|
The command
|
|
|
|
.I mkdir
|
|
|
|
makes a new directory.
|
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I rmdir
|
|
|
|
removes a directory if it is empty, and complains otherwise.
|
|
|
|
.LP
|
|
|
|
The command
|
|
|
|
.I find
|
|
|
|
(with a rather baroque syntax) will find files with given name
|
2008-06-12 06:09:19 +00:00
|
|
|
or other properties.
|
|
|
|
For example, "find . \-name tel" would find
|
2004-11-03 13:51:07 +00:00
|
|
|
the file "tel" starting in the present directory (which is called ".").
|
2005-07-06 07:41:37 +00:00
|
|
|
And "find / \-name tel" would do the same, but starting at the root
|
2008-06-12 06:09:19 +00:00
|
|
|
of the tree.
|
|
|
|
Large searches on a multi-GB disk will be time-consuming,
|
2004-11-03 13:51:07 +00:00
|
|
|
and it may be better to use
|
|
|
|
.BR locate (1).
|
|
|
|
.SS "Disks and Filesystems"
|
|
|
|
The command
|
|
|
|
.I mount
|
2008-03-19 07:26:08 +00:00
|
|
|
will attach the file system found on some disk (or floppy, or CDROM or so)
|
2008-06-12 06:09:19 +00:00
|
|
|
to the big file system hierarchy.
|
|
|
|
And
|
2004-11-03 13:51:07 +00:00
|
|
|
.I umount
|
|
|
|
detaches it again.
|
|
|
|
The command
|
|
|
|
.I df
|
|
|
|
will tell you how much of your disk is still free.
|
|
|
|
.SS "Processes"
|
intro.1, time.1, accept.2, bind.2, connect.2, execve.2, flock.2, getdents.2, getpriority.2, getuid.2, intro.2, ioctl.2, mincore.2, mknod.2, personality.2, ptrace.2, read.2, recv.2, select_tut.2, send.2, sendfile.2, shmctl.2, sigaction.2, signal.2, stat.2, times.2, truncate.2, umask.2, wait.2, MB_CUR_MAX.3, MB_LEN_MAX.3, argz_add.3, btowc.3, clearenv.3, clock.3, cmsg.3, end.3, endian.3, errno.3, exit.3, fgetwc.3, fgetws.3, fopen.3, fputwc.3, fputws.3, fseek.3, fwide.3, getfsent.3, getgrnam.3, gethostid.3, getipnodebyname.3, getmntent.3, getpwnam.3, getwchar.3, grantpt.3, iconv.3, iconv_close.3, iconv_open.3, insque.3, intro.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, malloc.3, mblen.3, mbrlen.3, mbrtowc.3, mbsinit.3, mbsnrtowcs.3, mbsrtowcs.3, mbstowcs.3, mbtowc.3, mkstemp.3, mktemp.3, nl_langinfo.3, openpty.3, posix_openpt.3, printf.3, ptsname.3, putwchar.3, qecvt.3, rcmd.3, readdir.3, rexec.3, rpc.3, setnetgrent.3, shm_open.3, sigpause.3, stdin.3, stpcpy.3, strftime.3, strptime.3, syslog.3, towctrans.3, towlower.3, towupper.3, ttyslot.3, ungetwc.3, unlocked_stdio.3, wcpcpy.3, wcpncpy.3, wcrtomb.3, wcscasecmp.3, wcscat.3, wcschr.3, wcscmp.3, wcscpy.3, wcscspn.3, wcsdup.3, wcslen.3, wcsncasecmp.3, wcsncat.3, wcsncmp.3, wcsncpy.3, wcsnlen.3, wcsnrtombs.3, wcspbrk.3, wcsrchr.3, wcsrtombs.3, wcsspn.3, wcsstr.3, wcstok.3, wcstombs.3, wcswidth.3, wctob.3, wctomb.3, wctrans.3, wctype.3, wcwidth.3, wmemchr.3, wmemcmp.3, wmemcpy.3, wmemmove.3, wmemset.3, wprintf.3, console_ioctl.4, pts.4, elf.5, filesystems.5, hosts.5, proc.5, ttytype.5, boot.7, capabilities.7, credentials.7, epoll.7, glob.7, koi8-r.7, path_resolution.7, pty.7, signal.7, suffixes.7, time.7, unicode.7, unix.7, uri.7, utf-8.7: global fix: s/Unix/UNIX/
The man pages were rather inconsistent in the use of "Unix"
versus "UNIX". Let's go with the trademark usage.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-12 04:45:38 +00:00
|
|
|
On a UNIX system many user and system processes run simultaneously.
|
2004-11-03 13:51:07 +00:00
|
|
|
The one you are talking to runs in the
|
|
|
|
.IR foreground ,
|
|
|
|
the others in the
|
|
|
|
.IR background .
|
|
|
|
The command
|
|
|
|
.I ps
|
|
|
|
will show you which processes are active and what numbers these
|
|
|
|
processes have.
|
|
|
|
The command
|
|
|
|
.I kill
|
2008-06-12 06:09:19 +00:00
|
|
|
allows you to get rid of them.
|
|
|
|
Without option this is a friendly
|
|
|
|
request: please go away.
|
|
|
|
And "kill \-9" followed by the number
|
2004-11-03 13:51:07 +00:00
|
|
|
of the process is an immediate kill.
|
|
|
|
Foreground processes can often be killed by typing Control-C.
|
|
|
|
.SS "Getting information"
|
|
|
|
There are thousands of commands, each with many options.
|
|
|
|
Traditionally commands are documented on
|
|
|
|
.IR "man pages" ,
|
|
|
|
(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
|
|
|
|
sends the text through some
|
|
|
|
.IR pager ,
|
|
|
|
usually
|
|
|
|
.IR less .
|
|
|
|
Hit the space bar to get the next page, hit q to quit.
|
|
|
|
.LP
|
2005-06-24 14:17:21 +00:00
|
|
|
In documentation it is customary to refer to man pages
|
2004-11-03 13:51:07 +00:00
|
|
|
by giving the name and section number, as in
|
|
|
|
.BR man (1).
|
|
|
|
Man pages are terse, and allow you to find quickly some forgotten
|
2008-06-12 06:09:19 +00:00
|
|
|
detail.
|
|
|
|
For newcomers an introductory text with more examples
|
2004-11-03 13:51:07 +00:00
|
|
|
and explanations is useful.
|
|
|
|
.LP
|
2008-06-12 06:09:19 +00:00
|
|
|
A lot of GNU/FSF software is provided with info files.
|
|
|
|
Type "info info"
|
2004-11-03 13:51:07 +00:00
|
|
|
for an introduction on the use of the program "info".
|
|
|
|
.LP
|
2008-06-12 06:09:19 +00:00
|
|
|
Special topics are often treated in HOWTOs.
|
|
|
|
Look in
|
2004-11-03 13:51:07 +00:00
|
|
|
.I /usr/share/doc/howto/en
|
|
|
|
and use a browser if you find HTML files there.
|
|
|
|
.\"
|
|
|
|
.\" Actual examples? Separate section for each of cat, cp, ...?
|
|
|
|
.\" gzip, bzip2, tar, rpm
|
2006-08-03 06:13:56 +00:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR standards (7)
|