هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
Almost every command and config file has a manual page ("man page"). man NAME opens it in a pager (usually less). The pages are split into sections:
| Section | Contains |
|---|---|
| 1 | Commands for all users |
| 2, 3 | System calls and library functions (for programmers) |
| 4 | Device files |
| 5 | File formats and config files |
| 7 | Overviews and conventions |
| 8 | Commands for system administration (root) |
When a name exists in several sections (like passwd = command and file), give the section number: man 5 passwd.
Inside the pager: /word searches, n goes to the next match, G goes to the end (often to EXAMPLES), q quits.
طريقة الكتابة
man [OPTIONS] [SECTION] PAGE ...
man -k KEYWORD
man -f PAGE
man -K TEXTالخيارات 39
الأكثر استخدامًا
Find pages
Display
Settings
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 12
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Open the manual of a command
man useraddPress
/and type a word to search,nfor the next match,qto quit.2Open the manual of a config file
man 5 fstabSection 5 explains the six columns of /etc/fstab. Very useful in the exam.
3Find the right command for a job
man -k "logical volume"Lists every page that mentions it in its short description.
4Find only admin commands about a topic
man -k partition | grep '(8)'Section 8 = commands for root, like fdisk and parted.
5See the short description only
man -f passwd passwd (1) - change user password passwd (5) - the password fileTwo pages: the command (1) and the file format (5).
6Find where the page file is
man -w sshd_config /usr/share/man/man5/sshd_config.5.gzShows which package documentation you are reading.
7Jump straight to the examples
man nmcli-examplesSome tools have a separate examples page. For others, open the page and press
G, then scroll up to EXAMPLES.8Search all pages for a word in the text
man -K "PermitRootLogin"Slow, but finds pages that mention a word anywhere.
9Read a man page file that came with a download
man -l ./docs/mytool.1Works for any page file, also outside the system folders.
10Show all pages with the same name
man -a crontabFirst crontab(1) (the command), then crontab(5) (the file format). Press q to go to the next one.
11Save a page as plain text for notes
man ss | col -b > ss-manual.txtcol -bremoves the bold and underline codes.12Read the systemd unit options
man systemd.serviceThe pages systemd.unit, systemd.service and systemd.timer explain every option of unit files.
لا يوجد شيء يطابق هذا الفلتر.
انتبه
- "nothing appropriate" from
man -kusually means the search database is old or empty. Runmandbas root. - Minimal installs can miss man pages. Install the package
man-pagesand the documentation of the tool.
الملفات
/usr/share/man/- The man pages, one folder per section (man1, man5, man8 …).
/etc/man_db.conf- Settings of man and mandb.
نصائح للحفظ
- 1 = user commands, 5 = files, 8 = admin commands.
man -k= I do not know the name.man NAME= I know the name.- In the pager:
/search,nnext,Gend,qquit.