The zero-based Linux sixth chapter

Source: Internet
Author: User

The zero-based Linux sixth chapter


The universe is vast, boundless, the earth is just one of the eight planets in the solar system, as one of the countless planets, the earth is not special .... But... Small series of blog, absolutely ~ ~ Special ~

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/00/27/wKiom1mXko_DEo0FAAFAd-RPuqo933.jpg "title=" Ubiaoqing5885cb7d10d0b3327.jpg "width=" "height=" 194 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:200px;height : 194px; "alt=" wkiom1mxko_deo0faafad-rpuqo933.jpg "/>

(↑ A classmate who read a small blog)

OK ~ ~ This week small make up will not nonsense, go straight to the point ~ ~

Last week, I talked about setting up and canceling aliases alias Ualias , making the alias permanently active in the profile /ETC/BASHRC and ~/.bashrc viewing the current path PWD , text compiler Nano. Small series here do not do too much demonstration, have forgotten the classmate can review the contents of the fifth Chapter ~ ~

The next step is to start talking about this week's content, this week's content may be a bit messy ...

650) this.width=650; "src=" https://s2.51cto.com/wyfs02/M01/9E/D7/wKioL1mXl2fg4_9eAAAhlDcgC-o067.gif "title="% Z6WDTN (875dhh63 (e4oux4.gif "alt=" Wkiol1mxl2fg4_9eaaahldcgc-o067.gif "/>

(Spit Groove: Every time you speak is a mess!) )

The amount ... OK ~ Do not care about these details, although the chaos, but small made up to say very clear 650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/9E/D7/ Wkiol1mxl8rgkqosaaafbvjtno4223.jpg "title=" -17c23f93a77fdd80.jpg "alt=" Wkiol1mxl8rgkqosaaafbvjtno4223.jpg "/>

OK, the beginning: small in front of a lot of said about the file type, in fact, before the view is just a general, for some files, although the beginning is "-" but actually with LS view, the color is shown is green.

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9E/D7/wKioL1mXmUXSDXu8AAAOl_mfSHg912.png "title=" Qq20170819095007.png "width=" 550 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:550px;height:78px; "alt=" Wkiol1mxmuxsdxu8aaaol_mfshg912.png "/>

such as the small series above this picture, at this time, with the small part of the previous method is not too accurate, because the small part of the previous introduction, is the file system can be divided into the type, and this one, with "-" beginning (note!) "-" in the beginning, said to use Ls-l to view the file, There are many types of files for the characters in front of the file permission bit. So, what do you need to look at these types of files? This requires a small series of commands to be introduced next:

file: View files Type (Note: This command can view any file including the type of directory)

Now try to look at the type of file above

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9E/D7/wKioL1mXnFXCmKeZAAAgB3X2VFk591.png "title=" Qq20170819100316.png "width=" 550 "height=" Wuyi "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:550px;height:51px; "alt=" Wkiol1mxnfxcmkezaaagb3x2vfk591.png "/>

file follow the command followed by the file you want to view, you can see the type of the file ~ ~ What?? What do you mean you can't read? It doesn't matter, small can not understand ~ ~ (shy) Well, this time, we need to use Google or Baidu translation ~ ~ In short, we just need to know the/usr/bin directory of LS This file, we often use the command on the line ~

file commands are simple, but there are some options:

file-b: File type output does not display file name (no utility)

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9E/D7/wKioL1mXniag1HN1AAAfBO3qRbs850.png "title=" Qq20170819101058.png "width=" 550 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:550px;height:46px; "alt=" Wkiol1mxniag1hn1aaafbo3qrbs850.png "/>

The difference between entering the file command is that the previous filename does not show

File-l: If you are viewing a file with a soft link, you can view the file corresponding to the soft link directly

What do you mean by that sentence? Small series to find a soft link file first

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9E/D7/wKioL1mXnz-ALU-sAAARJVi-0MQ394.png "title=" Qq20170819101544.png "width=" 550 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:550px;height:66px; "alt=" Wkiol1mxnz-alu-saaarjvi-0mq394.png "/>

The so-called soft link is one file pointing to another file. About the specific description of the soft link, small series and then slowly with the students in detail ~ ~ ~ Now the small series directly with the file to view the document

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9E/D7/wKioL1mXoFfiCjnxAAAK_VGCAoM370.png "title=" Qq20170819102025.png "width=" 550 "height=" 106 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:550PX;HEIGHT:106PX; "alt = "Wkiol1mxofficjnxaaak_vgcaom370.png"/>

Well, this time the content of the display is short, the content is clear ~ ~ The content shown here is probably "link to soelim" file, meaning this is a symbolic link (also known as a soft link), the link to the Soelim file.

(Knock on the blackboard) attention, attention! The link file is displayed after the full path of a file, and the small part of the soft link to find the link file just like this soft link in the same directory, so there is only one file name.

Below, the small series with file-l to check

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9E/D7/wKioL1mXocuBBXPZAAAhlUBCNJM298.png "title=" Qq20170819102607.png "width=" 550 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:550PX;HEIGHT:47PX; "alt=" Wkiol1mxocubbxpzaaahlubcnjm298.png "/>

This time the display is basically the same as the above ~ ~ because the files placed in the/usr/bin directory are commands that all users can use, so when viewing the file types in this directory, the content displayed is basically the same.


Then, about the file command, the small part introduced here, the command there are many options, but the basic is not used, so the small series does not do too much to introduce ~ ~ So interested in studying other options of the classmate, you can use command Help to see the function of the command and its description. How to view the use of the command Help, small series next will be explained in detail with the students (WOW ~ ~ Finally successful pull this up, hem ~ ~ Perfect Cohesion Context ~ ~)


Each command we use now has their use help, which contains the explanation (description) of the command, the options of the command, the role of each option, the author's information, and so on ....

How do we get these use help?

(Knock on the blackboard!) Watch out!! Attention!! It's very important to make a small story below! Super Important!!

Whatis: Displays a brief description of the command, as well as a section of the command Help document

The first half of this command believes that there is no need to explain the small, and then "show the command to help the chapter of the document," the specific is what, and so on the students will understand the end ~ ~

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9E/D8/wKioL1mXqJDDlPhyAAALde6a558897.png "title=" Qq20170819105440.png "width=" 550 "height=" 119 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:550PX;HEIGHT:119PX; "alt = "Wkiol1mxqjddlphyaaalde6a558897.png"/>

Use the format Whatis to follow the commands you want to see directly. The whatis shown is interpreted as "listing the contents of the directory" for the LS command. The LS command, after our actual validation, is actually listing the contents of the directory, but how does the whatis command Find the description of these commands?? Small series now go to delete a file, and then try to use the whatis command

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9E/D8/wKioL1mXqqShpOQ-AAAKYJvgMA0899.png "title=" Qq20170819110412.png "width=" 550 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:550PX;HEIGHT:114PX; "alt = "Wkiol1mxqqshpoq-aaakyjvgma0899.png"/>

What?? I can't find out. The file that you just deleted is the index.db file in the /var/cache/man/ directory, which is the database file for the Whatis command (only in Centos7), The Whatis command converts the description of all the collected commands into binary storage in the Index.db file. How do I rebuild a database of whatis commands?


MANDB: Update the command information and store it in the Whatis database (CENTOS7)

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/00/28/wKiom1mXq_XA59NYAAAOOyxS7aM437.png "title=" Qq20170819110943.png "width=" 550 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:550px;height:90px; "alt=" Wkiom1mxq_xa59nyaaaooyxs7am437.png "/>

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9E/D8/wKioL1mXrAqR34HeAAAmu5aLBAk128.png "title=" Qq20170819110951.png "width=" 550 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:550PX;HEIGHT:69PX; "alt=" Wkiol1mxraqr34heaaamu5albak128.png "/>

This is the reconstruction of the Whatis database when the small section of the two graphs, pay attention to the last line,"Updating index cache for path '/usr/share/man/man3 '" and the second picture of the man5 , This is the section of the Help document for the command,Whatis The database that was collected, actually looking at these help documents, then documenting the descriptions of each command, and then recording the descriptions of the commands without looking at a command,Whatis will be viewed in the database in which it is stored. So, using Whatis to find a command is not real-time, and at this time, if we install a new command, the Whatis command database will not follow the update, but we need to manually update, or use Whatis is not found in the new installation of the command. There are some differences between updating the database Centos7 and CENTOS6:

CENTOS6 in Whatis database location:/var/cache/man/whatis

Manually update its database: Makewhatis


CENTOS7 in Whatis database location:/var/cache/man/index.db

Manually update its database: MANDB

Whatis This command needs to update the database, and each update will go to the help document one of the check, the process takes time, and we want to get the help of the command, not only to get the description of the command, but also to get the command how to use, and its options, functions and so on, obviously, The Whatis command is not enough to meet our needs.

When we do not know how to use the command, we want to quickly get the options and functions of the command, at this time, some commands have their own long options to help us quickly get help

--help

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9E/D8/wKioL1mXsmrAtvT2AABJU61g0KI687.png "title=" Qq20170819113728.png "width=" 550 "height=" 201 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:550PX;HEIGHT:201PX; "alt = "Wkiol1mxsmratvt2aabju61g0ki687.png"/>

After the command is followed by the--HELP option, the use Help for the command appears. Try a little part again ~

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9E/D8/wKioL1mXsyLD5aNnAAANVJ-OfhE974.png "title=" Qq20170819114037.png "width=" 550 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:550PX;HEIGHT:114PX; "alt = "Wkiol1mxsyld5annaaanvj-ofhe974.png"/>

What the hell?? No, can't get help with the pwd command?

For some orders, the use of help is not the same, and what are the commands?


Note ~ ~ Small series here to extend a content: internal command; external command

So, what is an internal command and what is an external command??

well ... This is like homework ~ ~ Students in private to understand the internal commands and external commands (spit Groove: You really are not clear!) How can there be such a small compilation! )

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/00/28/wKiom1mXtYXBmQ4uAAAJbKNiTg4775.jpg "title=" 66f9615e9a042353.jpg "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:120px;height:130px; "alt = "Wkiom1mxtyxbmq4uaaajbknitg4775.jpg"/>

(↑ The mood of the small series at this time)


Use Help to get command assistance, for different commands, in the format:

Command--help: external command Get help

Help-command: Internal command Get help


So, using Help for different types of commands, how do we know if the commands are external or internal?

Passers-by: "Get help when the two formats are tried, the first one does not use a second ~ ~"

Small part how can have so stupid student 650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/00/29/wKiom1mXuDrzP_e9AAAKM2GPkhE942.jpg " Title= "]8x9%t}}nalva~rlwo18vic.jpg" width= "height=" border= "0" hspace= "0" vspace= "0" style= "width:60px;height : 36px; "alt=" wkiom1mxudrzp_e9aaakm2gpkhe942.jpg "/> But... There seems to be no wrong 650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9E/D8/wKioL1mXuHHgS29JAAAQogUde54039.jpg "title= "497ed602116eaa89.jpg" width= "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:45px;height:42px; "alt=" Wkiol1mxuhhgs29jaaaqogude54039.jpg "/>

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9E/D8/wKioL1mXue3Tkji1AAAWohoH8Ls510.jpg "title="- 3c1542be847ad49e.jpg "alt=" Wkiol1mxue3tkji1aaawohoh8ls510.jpg "/>

(↑ angry passers-by)

OK good ~ ~ ~ Small Make a joke ~ ~ with passers-by a method is also possible ~ ~ But, we are now professionals, um, professionals, so still use a professional way bar ~ ~

Type: View command type

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9E/D9/wKioL1mXvE-y7x_GAAAKqGkLaBQ696.png "title=" Qq20170819121943.png "width=" 550 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:550px;height:90px; "alt=" Wkiol1mxve-y7x_gaaakqgklabq696.png "/>

Type command can look at the types of commands, which are shown here with the Type View pwd command, and PWD is the shell's inline command.


The small part here involves a content ~ what is shell well ... This also as homework ~ ~ (Spit Groove: Do not stop me, I want to kill the small series!!) ~ ~ Calm Calm ~ ~ always give the students to leave some room for thinking ~ ~ The so-called Shell Inline command, is the small part of the internal command, and the use of internal commands to get Help method:

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/00/29/wKiom1mXvTKQmGj2AAAvMpRH3eE606.png "title=" Qq20170819122329.png "width=" 550 "height=" 211 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:550PX;HEIGHT:211PX; "alt = "Wkiom1mxvtkqmgj2aaavmprh3ee606.png"/>

The Help for the PWD command was successfully obtained.

However, with the help command to display only the command's brief assistance, sometimes we would like to get more detailed information, for example, to see the help of the command, but also want to see the description of the command, how to do?

Passers-by: "First use the Whatis command to see the description, and then help to get assistance ~ ~"

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/9E/D9/wKioL1mXvnLSGO4XAAAH7Weahyc961.jpg "title=" 1daeb34e10299edc.jpg "alt=" Wkiol1mxvnlsgo4xaaah7weahyc961.jpg "/>

(↑ This is a small series of people beating)

Passers-by: "I did not say wrong ... Why hit me ... Just now you did not hit passers-by 650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/9E/D9/wKioL1mXvsXTzMsUAAAGxfRjYmc014.jpg " Title= "44d4a5f5a4282726.jpg" width= "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:40px;height:40px; " alt= "Wkiol1mxvsxtzmsuaaagxfrjymc014.jpg"/> "

No way, who call people passers-by is a girl, and you are a boy 650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/00/29/ Wkiom1mxv12tw1qnaaaqogude54217.jpg "title=" 497ed602116eaa89.jpg "width=", "height=" border= "0" hspace= "0" vspace = "0" style= "width:45px;height:42px;" alt= "wkiom1mxv12tw1qnaaaqogude54217.jpg"/>

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/00/29/wKiom1mXv_zgvQ6hAABGMO1pW_4555.jpg "title="- 3c450a0d765ae52.jpg "width=" "height=" 109 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:150PX;HEIGHT:109PX; "alt= "Wkiom1mxv_zgvq6haabgmo1pw_4555.jpg"/>

(↑ passerby B with a mocking face looking at passers-by) "Poor Man"


OK ~ ~ As to how to get more detailed command Help ~ ~ The next period to explain it to you ~ ~

Do not forget the work of small knitting!! Two jobs!!


(funny) Then, again to relax time ~ ~ Let just injured passers-by to sing a "man flower" it

"Men's Flowers."

--the passers-by after being ridiculed

"When you protect her."

"to be her to protect you."

"....."-"."

"The man is also a flower ~"

"I'm afraid of the wind and rain ~

"... ...."

This article is from the "13125850" blog, please be sure to keep this source http://13135850.blog.51cto.com/13125850/1957578

The zero-based Linux sixth chapter

Related Article

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.