Linuxの使用中の4つのヘルプ(マニュアルと理解できる)
5804 ワード
マニュアル
(1) whatis
whatisコマンドは、コマンドが実行する機能をクエリーし、クエリー結果を端末に印刷するために使用されます.man-fコマンドの使用と同等
whatis [xxx]
//xxx: / / /
//1
[root@localhost ~]# whatis ls
ls (1) - list directory contents
ls (1p) - list directory contents
//2
[root@localhost ~]# whatis cp
cp (1) - copy files and directories
cp (1p) - copy files
//3
[root@localhost ~]# whatis chown
chown (1) - change file owner and group
chown (1p) - change the file ownership
chown (2) - change ownership of a file
chown (3p) - change owner and group of a file
//4
[root@localhost ~]# whatis man
man (1) - format and display the on-line manual pages
man (1p) - display system documentation
man (7) - macros to format man pages
man (rpm) - A set of documentation tools: man, apropos and whatis.
man-pages (rpm) - Man (manual) pages from the Linux Documentation Project.
man.config [man] (5) - configuration data for man
(2) help
まずshellの概念を理解します:shellは1つの命令解釈器で、linuxインタフェースで1つの命令を出す時、命令はまずshellに伝わって、それからこの命令をコンピュータが識別できるバイナリ言語に翻訳して、それからコンピュータのカーネルに伝えて、彼に何をするかを教えます.コンピュータのカーネルは結果をshellに返し、shellは大人のよく知っている言語を翻訳し、結果を示した.
help [xxx]
// ,
// : shell , , ,
[xxx] --help
// ,
// : , shell , shell ,
, 。
help
help xxx
xxx --help
note:内部コマンドと外部コマンドの区別:typeコマンドを使用して区別
//1
[root@localhost ~]# type cd
cd is a shell builtin
[root@localhost ~]# help cd
cd: cd [-L|[-P [-e]]] [dir]
Change the shell working directory.
Change the current directory to DIR. The default DIR is the value of the
HOME shell variable.
The variable CDPATH defines the search path for the directory containing
DIR. Alternative directory names in CDPATH are separated by a colon (:).
A null directory name is the same as the current directory. If DIR begins
with a slash (/), then CDPATH is not used.
If the directory is not found, and the shell option `cdable_vars' is set,
the word is assumed to be a variable name. If that variable has a value,
its value is used for DIR.
Options:
-L force symbolic links to be followed
-P use the physical directory structure without following symbolic
links
-e if the -P option is supplied, and the current working directory
cannot be determined successfully, exit with a non-zero status
The default is to follow symbolic links, as if `-L' were specified.
Exit Status:
Returns 0 if the directory is changed, and if $PWD is set successfully when
-P is used; non-zero otherwise.
[root@localhost ~]# cd --help
bash: cd: --: invalid option
cd: usage: cd [-L|[-P [-e]]] [dir]
//2
[root@localhost ~]# type ll
ll is aliased to `ls -l --color=auto'
[root@localhost ~]# help ll
bash: help: no help topics match `ll'. Try `help help' or `man -k ll' or `info ll'.
[root@localhost ~]# ll --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
。。。。。。
(3) man
manコマンドはLinuxのヘルプコマンドで、manコマンドでLinuxのコマンドヘルプ、プロファイルヘルプ、プログラミングヘルプなどの情報を表示できます.
man man manの使用方法の表示
man pageは大きく分けて以下の部分に分けられる:NAME:簡単なコマンド、データ名説明SYNOPSIS:短いコマンド構文(sysntax)概要DESCRIPTION:比較的完全な説明、OPTION:SYNOPSISに列挙されたすべての利用可能なオプション説明COMMANDS:このソフトウェアが実行されている場合、このソフトウェアで使用可能なコマンドFILES:このソフトウェアまたはデータで使用または参照またはリンクされたファイルSEE ALSE:参照可能、このコマンドに関する他の説明EXAMPLE:参照可能な例があります.この例はBUGS:関連バグがあるかどうかです.
使用小技巧:ctrl+FまたはPage Down:下へctrl+BまたはPage Up:上へggから最初の行GGから最後の行/start:start関連文字をマニュアル全体で検索でき、nを使用して次を検索し、Nを使用して前のjを検索し、kはviと同じように使用し、jは下へ、kは前の行dを下へ、uは上へ半分ページhを上へ
man section、manを使用すると異なるsectionを指定してブラウズできます
section
mean
意味
1
Executable programs or shell commands
標準ユーザコマンド(通常のコマンド)
2
System calls (functions provided by the kernel)
システムコール
3
Library calls (functions within program libraries)
ライブラリ呼び出し
4
Special files (usually found in/dev)
5
File formats and conventions eg/etc/passwd
passwdなどのファイルのフォーマットを指し、このファイルの各フィールドの意味を説明します.
6
Games
ゲーム
7
Miscellaneous (including macro packages and conventions), e.g. man(7),groff(7)
添付ファイルには、environというグローバル変数について説明する変数もあります.
8
System administration commands (usually only for root)
システム管理用のコマンドです.ifconfigなどのrootでしか使用できません.
9
Kernel routines [Non standard]
その他
//1
[root@localhost ~]# man 1 ls
//2
[root@localhost ~]# man 3 printf
(4) info
infoコマンドはLinuxのinfo形式のヘルプコマンドです.
内容については、infoページはman pageよりもよく、理解しやすく、友好的ですが、man pageは確かに使いやすいです.1つのman pageは1ページしかありませんが、infoページはほとんど常にそれらの内容を複数のセグメント(ノードと呼ばれる)に組織し、各セグメントはサブセグメント(サブノードと呼ばれる)を含むこともあります.このコマンドを理解するコツは、個々のInfoページでナビゲーションを参照する方法だけでなく、ノードとサブノードを切り替える方法も学ぶことです.最初はinfoページのノード間を移動したり、必要なものを見つけたりするのが難しいかもしれませんが、皮肉なことに、初心者にとってmanコマンドよりも良いものがあると思っていましたが、実際には勉強や使用が難しいです.
[root@localhost ~]# info info