The zero-based Linux fourth chapter

Source: Internet
Author: User

The zero-based Linux fourth chapter


Hello ~ ~ Small series and come back ~ ~

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/9D/BC/wKioL1mFFiiC75iwAAC8qB4I3zI150.jpg "title="- A512f81005df6f2.jpg "width=" "height=" 211 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:200px;height:211px "alt= "Wkiol1mffiic75iwaac8qb4i3zi150.jpg"/>

(the students were caught and thrown into the water ...)

Qaq ... How could you do this to a little ...?

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9D/BC/wKioL1mFGHCx5cCQAAKvg930AGA857.jpg "title=" 1497866790893.jpg "width=" height= "206" border= "0" hspace= "0" vspace= "0" style= "width:200px;height:206px;" alt= " Wkiol1mfghcx5ccqaakvg930aga857.jpg "/>

(PA: Collapse.. Boom.. A.. Boom.. Pa..)

(Small, black and black) amount ... The students seem to be in good spirits, getting up early and doing exercises are good for the body .... Well, for the students to have a full day, we ... Let's talk about learning.

Alas ~ ~ ~ Small series of typesetting changed and changed, always reach the desired effect ... Even.. Even more and more chaotic ...

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/BD/wKiom1mFG5-Q6QWAAAAEbi7w1g4872.jpg "title=" 4bbd1713ab7e8e89.jpg "width=" "height=" 106 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:100PX;HEIGHT:106PX; "alt = "Wkiom1mfg5-q6qwaaaaebi7w1g4872.jpg"/>

Never mind... Not tangled up ... Let this typesetting become a unique style bar ~ ~ ~ Ah, yes, to have a small part of their own writing style ~~~650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/9D/BD/ Wkiol1mfh6esbidiaaafbvjtno4011.jpg "title=" -17c23f93a77fdd80.jpg "width=" "height=" "border=" 0 "hspace=" 0 " Vspace= "0" style= "width:30px;height:30px;" alt= "wkiol1mfh6esbidiaaafbvjtno4011.jpg"/>

Passers-by a: "Small series adult run!!" The teacher went to get the knife! And said that you were allowed to run 39 meters first.

23333 ... (cachinnation ~), calm and calm, knife this thing does not exist ~ ~ ~ We still talk about what to learn today ~ ~

The previous chapter ~ Small series to give you a detailed explanation of the Linux file System , Linux, what must exist in the directory, and to see these directories and files need to use the command, in addition to the Linux command in the basic use of the format, The use of the LS command , as well as the user's default prompt , path , a brief introduction to the CD command.

In fact, although simple introduction, in fact, the use of CD command is very simple ~ ~ Just switch the role of the directory

The previous chapter we said the CD command followed by the path can be entered into the specified path, for example, the small series to enter the/etc/directory inside

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/9D/BD/wKiom1mFIbej-FdNAAAVIRZzI9E236.png "title=" Qq20170805093914.png "width=" "height=" 108 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:400PX;HEIGHT:108PX; "alt = "Wkiom1mfibej-fdnaaavirzzi9e236.png"/>

However, even if the CD command is simple, it is not just one usage.

The following ~ Small series will tell you about the other uses of this command ~ ~ Oh ~ ~ about why the command prompt has become a small series to enter the directory name, the small part of a chapter has been said, forget the classmate can turn on a chapter ~ ~

cd command usage:

Just a small part of the CD followed by the parameters into the specified path, the direct input CD is what effect?

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/BD/wKioL1mFI5KyT-ZMAAAhw-4sO3M369.png "title=" Qq20170805094709.png "alt=" Wkiol1mfi5kyt-zmaaahw-4so3m369.png "/>

Enter the CD directly and go back to the home directory.

Passers-by B: "But small series of adults ~ ~ Home Directory is a small series into the/etc/directory before the directory, so the direct Input CD command in the end is to enter the last directory? Or does it mean that no matter how many directories you enter, the CD will go back to your home directory? ”

Well, this question is good ~ ~ Now small make up to take everyone to try ~ ~

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/BD/wKioL1mFJd2TySqbAAAMU5JzEaQ520.png "title=" Qq20170805095659.png "width=" "height=" 98 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:450px;height:98px; "alt=" Wkiol1mfjd2tysqbaaamu5jzeaq520.png "/>

Now the small series into two consecutive directories, and then the small series of direct input CD

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9D/BD/wKiom1mFJiXR3XY3AAAOXIlVcVo446.png "title=" Qq20170805095813.png "alt=" Wkiom1mfjixr3xy3aaaoxilvcvo446.png "/>

So, after a small series of experiments, direct command line input CD will go directly to the home directory ~ ~ ~

What do you need to do to get into the last catalog?

The cd- can be switched back and forth directly from the last directory entered and the newly entered directory:

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/BD/wKioL1mFKSjSr9vbAAAW5Le_SII314.png "title=" Qq20170805101102.png "alt=" Wkiol1mfksjsr9vbaaaw5le_sii314.png "/>

Small series first entered the/app/directory, and then entered the/etc/directory, and at this time/app/directory relative to the/etc/directory as the last entry into the directory, you can use CD-to switch back and forth ~ ~ ~

Small series is now using the highest administrator user (root), sometimes need to go to the designated user's home directory to modify the specified user's files, at this time what to do?

The small part told the students, in bash, "~" represents the home directory. (spit slot: When did you tell us!) And also! Bash! What is it!! )

Ah ~ ~ didn't tell the classmates?? Do not care about these details ~ ~ now has not been told you ~ ~

Bash "~" represents the home directory, so we have to go to the home directory not only the command line input CD this way, but also:

CD ~

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/9D/BE/wKioL1mFK8Gj0_ciAAAJ9qf_T6g285.png "title=" Qq20170805102206.png "alt=" Wkiol1mfk8gj0_ciaaaj9qf_t6g285.png "/>

Look, you can still go back to your home directory. Small series just said, want to go to the designated user's home directory to do? And, of course, add the specified user name to the back.

CD ~username

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9D/BE/wKiom1mFLJjjQ0vPAAAJ7AwdWp8364.png "title=" Qq20170805102539.png "alt=" Wkiom1mfljjjq0vpaaaj7awdwp8364.png "/>

Note that this entry to other users of the home directory appears to be only the administrator (root) to operate it ~ ~, also, attention to detail, "~" and the user name is no space directly!

In the previous chapter, we talked about the ls-a order, why did the small one suddenly mention the order? The students also do a week of practice ~ Careful classmates will find that with ls-a This command to view the directory of hidden files, regardless of which directory, the directory will have "." With ".." Two directories, and what are these two? Let's take a look at the following small series:

. : Represents the directory that is currently located

For example, now small into the/etc/directory, and then use the CD. try it.

Cd.

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/BE/wKioL1mFMGmydrtcAAAMae1gwyE341.png "title=" Qq20170805104157.png "alt=" Wkiol1mfmgmydrtcaaamae1gwye341.png "/>

No change, CD. Represents the entry into the current directory.


Passerby A: "That CD." It's totally pointless! ”

What the!? You said it didn't make sense! Come!!! Drag it out! Kill him!

Onlookers: "Wow ~ this small make up actually bullying girls, too bad, scum"


What? Girls? Oops ~ ~ ~ Passers-by ~ ~ Are you all right ~ ~ Pain is not painful ah, there is no injury?? Wow, incredibly scratched the skin, who how vicious! Amount: Let's not talk about this, get in the car, hold me tight ~ ~ I'll take you to the hospital bandage ~ ~ ~

650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M01/9D/BE/wKioL1mFMnjhxfQgAAECrXhnFe8021.jpg "title="% Pzkndbo%xs6vx[lz~t] (fw.jpg "width=" "height=" 267 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:200px;height : 267px; "alt=" wkiol1mfmnjhxfqgaaecrxhnfe8021.jpg "/>

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/9D/BE/wKioL1mFMyWBj6NUAAAQogUde54648.jpg "title=" 497ed602116eaa89.jpg "width=" "height=" PNs "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:40PX;HEIGHT:37PX; "alt=" Wkiol1mfmywbj6nuaaaqogude54648.jpg "/> (Small series of life, the first XXX courtship failure) 650) this.width=650; src= HTTPS://S4.51CTO.COM/WYFS02 /m02/9d/be/wkiol1mfm5wdgyrvaaakm2gpkhe033.jpg "title="]8x9%t}}nalva~rlwo18vic.jpg "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:65PX;HEIGHT:39PX; "alt=" wkiol1mfm5wdgyrvaaakm2gpkhe033.jpg "/> (This is a story of the man behind the sad story)


(Think of the past the small part of tears to the students to lecture) we ... Let's go to class ...

for CDs. What's the use of it? Small part of the previous chapter said the concept of the path, the path is divided into absolute path and relative path. and when we use the absolute path, the CD. It's really useless, but we use the relative path, CD. This command will be of use.

And also! Especially important! “.” This is not only used on the switching path!! Can be used anywhere, such as writing a script later, after writing the script, you can directly "./script Name" indicates the current directory of XXX

A "." Already know what that means, that "..." It?

.. : Indicates a previous level of directory

For example, the widget now enters the/app/directory to create a subdirectory and then goes into this subdirectory

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/9D/BF/wKiom1mFOseQEonlAAAM1u9l_Rs372.png "title=" Qq20170805112604.png "alt=" Wkiom1mfoseqeonlaaam1u9l_rs372.png "/>

Then use the CD.

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/BF/wKiom1mFOx3hTE26AAAKxdkDLOE830.png "title=" Qq20170805112741.png "alt=" Wkiom1mfox3hte26aaakxdkdloe830.png "/>

Successful return to the top level directory ~ ~ ~ the same, "..." Not only can it be used with CDs, itself "." and ".." is to represent the path, all of which can be used anywhere that can represent a path ~ ~

Good ~ ~ CD command is here, Small series will not give the students summed up, left to the students to summarize it ~ in the summary at the same time will find that has been remembered, well, this is easy for students to remember (spit groove: You lazy do not want to summarize!) )

... The amount ... Don't mind the details. Above the CD command, the students in the back and forth to switch the path of the time will inevitably be divided, because some directory subdirectories and other directories in the subdirectory will be duplicated, and then how do we distinguish it?

PWD: View your current directory

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/9D/BF/wKiom1mFQSaQw-baAAAQCzQgweY517.png "title=" Qq20170805115322.png "alt=" Wkiom1mfqsaqw-baaaaqczqgwey517.png "/>

Now that the widget is now in the/app/directory, what's the effect? For example, the gadget now creates a directory under the/app/directory with the same name as one of the users.

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/9D/BF/wKioL1mFQcmAm7INAAAdYufJumo592.png "title=" Qq20170805115605.png "alt=" Wkiol1mfqcmam7inaaadyufjumo592.png "/>

Now small/app/directory has a name called Zzc directory, and the small part of one of the user's home directory is also called ZZC (specifically why, need to see the small part of a chapter on the FHS file structure of the/home directory)

Now the small part in these two directories directly switch back and forth

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/BF/wKiom1mFQu-REeP7AAAoZo4Yvww968.png "title=" Qq20170805120058.png "alt=" Wkiom1mfqu-reep7aaaozo4yvww968.png "/>

.. Amount: Well, it is still possible to distinguish between the directory, but after the input of the command more, it will inevitably confuse, so you can use pwd to view the current directory

Passers-by B: "Small adult ~ Why do I have some documents to go?" ”

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9D/BF/wKioL1mFRMKjo_cTAAAU9xsyDv0726.png "title=" Qq20170805120848.png "alt=" Wkiol1mfrmkjo_ctaaau9xsydv0726.png "/>

Passers-by B: "There is such a hint"

I forgot to tell you the story ~ ~

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/C0/wKiom1mFR_GB66NxAABeUhp-Qpc319.jpg "title=" Zjqgswyqo[ty%boh7i ' 12qk.jpg "width=" height= "182" border= "0" hspace= "0" vspace= "0" style= "width:200px;height : 182px; "alt=" Wkiom1mfr_gb66nxaabeuhp-qpc319.jpg "/> (the mood of passers-by at this time)

Well, it's not too late. The directory is always mentioned in the small series, but in fact the directory is also a file, and the file is divided into several types:

File type: the

-: Normal file

D: Catalog file

B: Block device files

C: Character device file

L: Link File

P: Pipeline File

S: Socket file


The classification of these file types is based on the first character at the beginning of a file.

So, how do you see the first character in the beginning of these files, the previous chapter we talked about using ls-l to view the file details

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/9D/BF/wKioL1mFSnazySsUAAAZ303k_f4862.png "title=" Qq20170805123305.png "alt=" Wkiol1mfsnazyssuaaaz303k_f4862.png "/>

This is the detailed information for viewing a file, which is based on

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/BF/wKioL1mFSqmiPK0RAAADZ9LraiA370.png "title=" Qq20170805123355.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:200px;height:51px; "alt=" Wkiol1mfsqmipk0raaadz9lraia370.png "/>

The first character in the leftmost string to determine the file type, the file is small to start with D, so it is a directory file. And what is the string behind that character d? The following is the permissions of this file, now do not need to know these ~ ~

But how to judge a file type good trouble, there is no simpler?

Hum, let this small adult to tell you.


↓ (teacher to get the knife back)

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/9D/C0/wKiom1mFS8Gzzm_CAAAZhe9gLcg684.jpg "title=" Timg.jpg "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:250px;height:250px; "alt=" Wkiom1mfs8gzzm_caaazhe9glcg684.jpg "/>

(The teacher who brought the knife back): "Small, what did you say?" Typography doesn't matter? Want to be a blog of your own style? I allow you to run 39 meters first. ”


(How can there be a knife in this place?) Why is it so long? No, no, no. Teacher... The teacher is calm ... I.. I mean, typography ... Very important ... I will try to correct the ... Don't chop ... (When you're done, turn around and run)

650) this.width=650, "src=" Https://s5.51cto.com/wyfs02/M00/9D/BF/wKioL1mFTKfgdooHAABT90Qkeq8673.png "title=" $KH 5N (xu_s] C9j]i ' K3 ') 2.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:250px;height:250px; "alt=" Wkiol1mftkfgdoohaabt90qkeq8673.png "/>

↑ (Jr., aged 18)

End End


(This blog is a little short, this is because ...) Because a lot of homework has not been done ... A lot of scripts haven't written yet ... The teacher left a script that scrambled chicken and scrambled chicken. All the brains are going to blow up.

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/9D/C0/wKiom1mFToyiDx9JAAG9_NHG6po537.gif "title=" 10b8ce7ab5b0d617.gif "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:200px;height:200px; "alt = "Wkiom1mftoyidx9jaag9_nhg6po537.gif"/>

In order to set aside more time to write scripts, this week's blog will come here ~)

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

The zero-based Linux fourth chapter

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.