A new way to learn Linux (ii)

Source: Internet
Author: User
Tags file copy

    1. Directories in Linux

      650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8F/4B/wKioL1jaMqOCn98aAAB5z0WXz-Y160.png "title=" Screenshot from 2017-03-27 16-32-18.png "alt=" Wkiol1jamqocn98aaab5z0wxz-y160.png "/>

/root directory

/bin # #存放必要的命令

/Boot # #存放内核以及启动所需要的文件

/Dev # #存放系统配置文件

/Home # #普通用户的宿主目录, the user data resides in its main directory

/lib # #32位系统存放必要文件的运行库

/LIB64 # #64位系统存放必要文件的运行库

/MNT # #存放临时的映射文件系统, usually used to mount

/proc # #存放存储进程和系统信息

/root # #超级用户的主目录

/sbin # #存放系统管理程序

/tmp # #存放临时文件

/usr # #存放应用程序, command program files, libraries, manuals, and other documents

/var # #系统默认存放日志的目录

/media # #系统临时设备挂载点

/OPT # #第三方软件安装位置

/run # #系统临时设备挂载点

/SRV # #系统数据

/sys system Management, mainly on the kernel

2. Addressing the file

Absolute path: FileName begins with "/" and is the real location of the file in the system

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/8F/4D/wKiom1jaTdeBesNmAABj0_Ku20E865.png "title=" Screenshot from 2017-03-27 16-34-16.png "alt=" Wkiom1jatdebesnmaabj0_ku20e865.png "/>

Relative path: File name does not begin with "/", he is a shorthand for the position of the document relative to the current location

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/8F/4C/wKioL1jaTe3BEA6sAABjD927iHk945.png "title=" Screenshot from 2017-03-27 16-34-36.png "alt=" Wkiol1jate3bea6saabjd927ihk945.png "/>

3. Management of documents

*) Touch Build File

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/8F/4D/wKiom1jaTgzzQzI_AABjD927iHk824.png "title=" Screenshot from 2017-03-27 16-34-36.png "alt=" Wkiom1jatgzzqzi_aabjd927ihk824.png "/>

*) mkdir Build Directory

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/8F/4D/wKiom1jaTlXQK5-KAACOcMe-nAU086.png "title=" Screenshot from 2017-03-27 16-41-39.png "alt=" Wkiom1jatlxqk5-kaacocme-nau086.png "/>

Create a directory #当要建立的目录不存在上级目录时可以使用-p recursion

*) RM Delete file or directory

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/8F/4C/wKioL1jaTxzzcgQXAAApUt8o_D8312.png "title=" Screenshot from 2017-03-28 16-48-48.png "alt=" Wkiol1jatxzzcgqxaaaput8o_d8312.png "/>

##-f indicates forced removal, without prompting

##-r means to delete a directory

*) Cat/head/tail View file contents


*) Vim text mode edit file

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/8F/4E/wKiom1jaUDngNXhmAAAKHBKbIHI181.png "title=" Screenshot from 2017-03-27 19-44-02.png "alt=" Wkiom1jaudngnxhmaaakhbkbihi181.png "/>

# # VIM filename goes into command mode

Command mode cannot edit the file, if you want to edit the file press "I" to enter the insert mode, complete the edit press "ESC" exit insert mode, enter ": Wq" Save the Edit and exit

*) CD Switch working directory

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8F/4E/wKiom1jaUQzDzdJXAAC9Dso210Q041.png "title=" Screenshot from 2017-03-28 14-18-29.png "alt=" Wkiom1jauqzdzdjxaac9dso210q041.png "/>

# CD Directory # #切换工作目录到指定目录

# CD-# #切换工作目录到之前所在的目录

# cd ~ # #切换到自己的家目录

# CD ~username # #切换到指定用户 home Directory

# CD: # #进入当前目录的上级目录

*) LS lists directory or text information

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/8F/4E/wKiom1jaUhHBciNBAAEoKeB3j8U582.png "title=" Screenshot from 2017-03-28 14-37-02.png "alt=" Wkiom1jauhhbcinbaaeokeb3j8u582.png "/>


*) CP file copy

(1.) Copy the #将桌面的file file2 file to the/mnt/directory

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/8F/4E/wKiom1jaUlqhijYMAACpxglHCXM071.png "title=" Screenshot from 2017-03-28 14-39-41.png "alt=" Wkiom1jaulqhijymaacpxglhcxm071.png "/>

(2.) # Copy the file and rename it to AA

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/8F/4E/wKiom1jaUrCTmeIWAACL-Y4U1p4894.png "title=" Screenshot from 2017-03-28 14-48-22.png "alt=" Wkiom1jaurctmeiwaacl-y4u1p4894.png "/>

(3.) #将zz目录复制并重新命名为cc

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/8F/4C/wKioL1jaU1fjMVhuAAChp85lslA050.png "title=" Screenshot from 2017-03-28 14-49-32.png "alt=" Wkiol1jau1fjmvhuaachp85lsla050.png "/>

*) MV Move or rename

(1.) #将文件aa移动到目录zz中去

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/8F/4C/wKioL1jaU_qSL3FNAABrFq4u2hY570.png "title=" Screenshot from 2017-03-28 14-51-40.png "alt=" Wkiol1jau_qsl3fnaabrfq4u2hy570.png "/>

(2.) #将文件file重新命名为qwe # # If Qwe is a file name does not exist

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/8F/4E/wKiom1jaVEST8n8xAABV9cQJdSs242.png "title=" Screenshot from 2017-03-28 14-52-12.png "alt=" Wkiom1javest8n8xaabv9cqjdss242.png "/>

(3.) Move Linux in Westos to the current directory, "." Represents the current directory

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/8F/4C/wKioL1jaVaLhUCUWAABZWmhO2K4401.png "title=" Screenshot from 2017-03-28 14-59-01.png "alt=" Wkiol1javalhucuwaabzwmho2k4401.png "/>

3. Regular expressions

(1.)

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/8F/4E/wKiom1jaWD6iS14kAAHLQ3fvEJo117.png "title=" Screenshot from 2017-03-28 19-15-57.png "alt=" Wkiom1jawd6is14kaahlq3fvejo117.png "/>

(2.)

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/8F/4C/wKioL1jaV9GzML_aAADBsHe21aQ092.png "title=" Screenshot from 2017-03-28 19-18-15.png "alt=" Wkiol1jav9gzml_aaadbshe21aq092.png "/>

indicating the existence or non-existence of

#{1..9} # #1-9

#{1,3,5} # #135

#{1..3}{a. C} # #1a 2a 3a 1b 2b 3b 1c 2c 3c

(3.)

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/8F/4E/wKiom1jaV-HivCM1AAB6r0gVAMQ931.png "title=" Screenshot from 2017-03-28 19-19-30.png "alt=" Wkiom1jav-hivcm1aab6r0gvamq931.png "/>

(4.) indicates the existence of the

[A-c] # #aA BB CC

[A-c] # #aA或者bB或者cC

[1-3] # #1或者2或者3

[145] # #1或者4或者5

[^ABC] [!ABC] # #除了a并且除了b并且除了c

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/8F/4C/wKioL1jaV--Cls6CAABBdOXKnHo842.png "title=" Screenshot from 2017-03-28 19-25-59.png "alt=" Wkiol1jav--cls6caabbdoxknho842.png "/>


A new way to learn Linux (ii)

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.