Linux Man Command Basic use

Source: Internet
Author: User
Tags glob uppercase letter knowledge base

man: When you don't know how to use a command, don't worry, there are many help documents on Linux where the Man command is the most effective way to use. "Man" Here is not men, it is manua (manual) shorthand. The use of most commands can be found by simply executing the man command command.


The configuration file for man is:/etc/man.config (centos6.#)

/ETC/MAN_DB.COF (CENTOS7)


The file path for man is:/usr/share/man


/usr/share/doc Directory

Subdirectories of most installed packages, including the relevant principles of these software


Man is divided into nine chapters, and different chapters correspond to different meanings. Some command and file name conflict, you can first use Whatis first to see its chapter number. such as the passwd command, so that you can more accurately find the command you want to understand the meaning of the interpretation.

[[email protected] ~]# whatis passwd #whatis: Basic explanation of the command (see chapter number)

SSLPASSWD (1SSL)-Compute password hashes

passwd (1)-Update user ' s authentication tokens #更改用户密码

passwd (5)-Password file #密码文件


1: User command

2: System call

3:C Library Call

4: Equipment files and special files

5: Configuration file Format

6: Game

7: Miscellaneous

8: Commands for managing Classes

9:linux Kernel API

How to use man: a man LS as an example

NAME

Ls-list Directory Contents #列出基本意思


Synopsis

ls [OPTION] ... [FILE] ... #语法格式

#[]: Optional options

#.... : can have multiple or single

#<>: Required

#a |b|c: Choose one More

DESCRIPTION

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 is Mandatory for

Short options too.

#选项示意

-A,--all # Show all entries

Do not ignore entries starting with.


-A,--almost-all #显示所有条目, except. and.

Do not list implied. and..


--author #列出作者名 (more accurate sense of the owner)

With-l, print the author of each file

..... such as


How to: Use the less form

Space,^v,^f,^f: Turn the file on the tail screen

B,^B: Flip the screen to the file header

D,^d: Flip the screen to the end of the file

U,^u: Turn half screen to file header

Reture,^n,e,^e or J or ^j: Flip a line to the end of a file

Y or ^y or ^p or K or ^k: Flip a line to the file header

Q: Exit

#: Jump to # line

1 g: Back to File header

G: Turn to the tail of the file


/keyword:

Searches the end of the file from the current position with the string specified by keyword as the keyword;

N: Next

N: Previous

? KEYWORD:

The string specified by keyword is the keyword, and the file header is searched from the current position;

N: Same direction as search command, next

N: Follow the search command in the opposite direction, previous


Info Read Info documents: Read information file

Info can be added as a man, its page is like a website structure, each part of a "node" * represents a connection, and some commands are written more fully in info.

How to do info:

arrow keys, PGUP,PGDN navigation

TAB key to move to next link

d Display the theme directory

Home Display Theme Header

Enter to enter the selected link

N/P/U/L go to Next/previous/previous/last link

s text text Search

Q Exit Info


More ways to get information

Other information can be obtained from official documents of some third-party software companies ' websites


Red Hat Knowledge Base and official online documentation

Http://kbase.redhat.com

Http://www.redhat.com/docs

Http://access.redhat.com


Access to information is a skill that every ops person needs to master, and the ability to get help determines the skill of the technology!


File wildcard: Is a special statement, mainly with an asterisk (*) and a question mark (?), used to blur the search file.

*: Match 0 or more characters

?: matches any single character

~: Current User home Directory

~:username User Home Directory

~+: Current Working directory

~-: Previous working directory


Man 7 glob: Find the Glob interpretation of Chapter 7 of the Manual


[0-9]: match a range of numbers

[A-Z]: uppercase and lowercase letters (except Z)

[A-z]: uppercase letters (except A)

[Email protected] testdir]# lsa123f Aet2 FDA fdz zdsdz Zsdf12 zsga #testdir下的文件 [[email protected] testdir]# ls [A- z]*a123f Aet2 FDA fdz zdsdz ZSGA #Zsdf12没有列出! [[email protected] testdir]# ls [a-z]*aet2 fda fdz zdsdz Zsdf12 ZSGA #a123f没有列出!

[Alan]: Match any one of the characters in the list

[^gentoo]: matches a character other than all characters in the list

[:d Igit:]: Any number, equivalent to 0-9

[: Lower:]: Any lowercase letter

[: Upper:]: Any uppercase letter

[: Alpha:]: Any case letter

[: Alnum:]: Any number or letter

[: Space:]: space

[:p UNCT:]: Punctuation characters


This article is from the "10974793" blog, please be sure to keep this source http://nieqi.blog.51cto.com/10974793/1832189

Linux Man Command Basic use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.