Small White Linux Learning Tour (ii)

Source: Internet
Author: User
Tags file copy parent directory temporary file storage uppercase letter

First, the Linux system structure

Linux is an inverted tree structure
Everything in Linux is a file.
These files are at the top of the system directory "/"/is the root directory
/directory Below is a level two directory these directories are automatically created when the system is installed
The role of the secondary directory
/bin binary executable file is a system command
/sbin System Management Command storage location
/boot boot partition, responsible for system boot
/dev Device Management files
/etc most system administration files
Home directory for normal users
/lib 32-bit system library file storage location
/LIB64 64-bit system library file storage location
/media System temporary Device mount point
/MNT System temporary Device mount point
/run System temporary Device mount point
/OPT third-party software installation location
/proc System Information
/root Super User home Directory
/srv,/var System Data
/sys system Management, mainly about the kernel
/tmp system temporary file storage location
/usr System user-related information data and user-defined software storage location

Ii. addressing the file

Absolute path
File in the real location of the system, the file name begins with "/"
Relative path
The file relative to the current location of the name of a shorthand, the name does not start with/, and the name will automatically add the value of the PWD display

III. Management of documents

1.touch creating files or modifying file timestamps

Touch File Creation File

650) this.width=650; "Width=" 501 "height=" 281 "title=" 221 01.png "style=" width:586px;height:281px; "alt=" Wkiol1nnfhlq-_kvaaezgx_017g588.png-wh_50 "src=" https://s5.51cto.com/wyfs02/M01/A6/5C/wKioL1nNfhLQ-_kvAAEZGx_ 017g588.png-wh_500x0-wm_3-wmp_4-s_974023814.png "/>

2. mkdir Building a Directory

mkdir Directory Creation
-P Parent Directory does not exist automatically established

650) this.width=650; "Width=" 502 "height=" 281 "title=" 222 02.png "style=" width:598px;height:281px; "alt=" Wkiom1nnfodbo1uoaaeshrio43e046.png-wh_50 "src=" https://s1.51cto.com/wyfs02/M00/07/AB/ Wkiom1nnfodbo1uoaaeshrio43e046.png-wh_500x0-wm_3-wmp_4-s_3937842537.png "/>

3.RM Delete

Rm-f forcibly removed without prompting
-R Delete Directory

650) this.width=650; "Width=" 502 "height=" 281 "title=" 223 03.png "style=" width:598px;height:281px; "alt=" Wkiol1nnfnvr04m3aaefr3fd8sc906.png-wh_50 "src=" https://s1.51cto.com/wyfs02/M02/A6/5C/ Wkiol1nnfnvr04m3aaefr3fd8sc906.png-wh_500x0-wm_3-wmp_4-s_445368550.png "/>

4. Cat|head|tail View in File

Cat|head|tail File Content View command

650) this.width=650; "Width=" 503 "height=" 281 "title=" 224 04.png "style=" width:607px;height:281px; "alt=" Wkiom1nnfuhriyryaaf4d6osely999.png-wh_50 "src=" https://s3.51cto.com/wyfs02/M01/07/AB/ Wkiom1nnfuhriyryaaf4d6osely999.png-wh_500x0-wm_3-wmp_4-s_2535416052.png "/>

5. Vim Text mode edit file

Vim filename enters the command mode in addition to the directory or file

Command mode cannot edit the file if you want to edit the file to enter insert mode
Press "I" to enter insert mode
If you are finished editing, press "ESC" to eject the insert mode and enter ": Wq" to save the exit

Vim filename If the file name does not exist, it will be created automatically

Vim no Action object opens directly, after editing the file to: Wq filename

650) this.width=650; "Width=" 501 "height=" 281 "title=" 225 05.png "style=" width:629px;height:281px; "alt=" Wkiom1nnfwzynoxsaag8vc8sg6k895.png-wh_50 "src=" https://s2.51cto.com/wyfs02/M00/07/AB/ Wkiom1nnfwzynoxsaag8vc8sg6k895.png-wh_500x0-wm_3-wmp_4-s_596343571.png "/>

6. CD Switch working directory

CD directory switch working directory to the specified directory

CD-Switch working directory to previous directory

CD ~ Switch to your home directory
CD ~usernmae switch to the specified user home directory

Cd.. Go to the parent directory of the current directory

650) this.width=650; "Width=" 502 "height=" 281 "title=" 226 06.png "style=" width:638px;height:281px; "alt=" Wkiol1nnfuyhigvyaadkeigkc3y226.png-wh_50 "src=" https://s4.51cto.com/wyfs02/M01/A6/5C/ Wkiol1nnfuyhigvyaadkeigkc3y226.png-wh_500x0-wm_3-wmp_4-s_1956137304.png "/>

7. LS lists directory or file information

LS If there is no target behind then the default target is the current directory
LS direcory|filename list file or directory contents
ls-d direcotry List the directory itself
Ls-l Filename|dorectory lists the properties of the contents of a file or directory
Ls-ld directory lists the properties of the catalog itself
LS-A displays all content in the directory, including the "." Hidden files at the beginning
Ls-r to display content in a directory

650) this.width=650; "Width=" 503 "height=" 281 "title=" 227 07.png "style=" width:621px;height:281px; "alt=" Wkiol1nnfwytgwmxaahssgpufuu122.png-wh_50 "src=" https://s2.51cto.com/wyfs02/M00/A6/5C/ Wkiol1nnfwytgwmxaahssgpufuu122.png-wh_500x0-wm_3-wmp_4-s_3527740629.png "/>

8.CP file copy

CP is the process of creating a new file

CP file File1 file2. directory to copy file File1 file2 to Directory
CP file test establishes the test file template
Cp-r Directory Direcotry1 Replicating directories

650) this.width=650; "Width=" 502 "height=" 281 "title=" 228 08.png "style=" width:619px;height:281px; "alt=" Wkiom1nnf2yyhqy7aag7-me61tq714.png-wh_50 "src=" https://s5.51cto.com/wyfs02/M02/07/AB/ Wkiom1nnf2yyhqy7aag7-me61tq714.png-wh_500x0-wm_3-wmp_4-s_381665753.png "/>

9.MV Move or rename

The MV of the same disk is renamed, and the MV of different disks is the copy-delete process

MV file file1 direcotry move file file1 into directory
MV presence file does not exist file rename file
MV Westos/linux. Move Linux in Westos to the current directory. Represents the current directory

650) this.width=650; "Width=" 501 "height=" 281 "title=" 229 09.png "style=" width:612px;height:281px; "alt=" Wkiol1nnf0xho5wqaagyxemctw0642.png-wh_50 "src=" https://s5.51cto.com/wyfs02/M02/A6/5D/ Wkiol1nnf0xho5wqaagyxemctw0642.png-wh_500x0-wm_3-wmp_4-s_1874846463.png "/>

Four, the regular expression

* Match 0 to any character
? Match a single character
[[: Alpha:]] matches a single letter
[[: Lower:]] matches a single lowercase letter
[[: Upper:]] matches a single uppercase letter
[[:d Igit:]] matches a single number
[[: Alnum:]] matches a single number or letter
[[:p UNCT:]] match a single symbol
[[: Space:]] match a single space

{} indicates a nonexistent or existing

650) this.width=650; "Width=" 502 "height=" 281 "title=" 2210 010.png "style=" width:614px;height:281px; "alt=" Wkiom1nnf9rregqtaafkopcnpks645.png-wh_50 "src=" https://s1.51cto.com/wyfs02/M00/07/AB/ Wkiom1nnf9rregqtaafkopcnpks645.png-wh_500x0-wm_3-wmp_4-s_1765845680.png "/>{1..9} 1-9
{A.. F} a-f
{1,3,5} 135
{A,c,e} a C E
{1..3} {A.. C} 1a 2a 3a 2a 2b 2c 3a 3b 3c

650) this.width=650; "Width=" 501 "height=" 281 "title=" 2212.png "style=" width:625px;height:281px; "alt=" wKiom1nNf_ Njrddoaafsowstdx4935.png-wh_50 "src=" https://s4.51cto.com/wyfs02/M00/07/AB/wKiom1nNf_ Njrddoaafsowstdx4935.png-wh_500x0-wm_3-wmp_4-s_999819033.png "/>

[] Indicates the existence of the
[A-c] AA BB CC
[a-c] AA or BB or C
[1-3] 1 or 2 or 3
[145] 1 or 4 or 5
[^abc]| [!ABC] except A and B and besides C

650) this.width=650; "Width=" 504 "height=" 281 "title=" 2213.png "style=" width:622px;height:281px; "alt=" Wkiol1nnf9tiesvjaaf_4vww6ye837.png-wh_50 "src=" https://s1.51cto.com/wyfs02/M02/A6/5D/wKioL1nNf9TieSvJAAF_ 4vww6ye837.png-wh_500x0-wm_3-wmp_4-s_273425738.png "/>

~                                        Current User home directory
~username                        specified user home directory
~+                                       current directory
~-                                       directory before current directory

. Current directory
.. Upper level of current directory

650) this.width=650; "Width=" 503 "height=" 281 "title=" 2214 014.png "style=" width:624px;height:281px; "alt=" Wkiol1nnf-3grqlvaafqdn9nsju151.png-wh_50 "src=" https://s2.51cto.com/wyfs02/M00/A6/5D/ Wkiol1nnf-3grqlvaafqdn9nsju151.png-wh_500x0-wm_3-wmp_4-s_1384799839.png "/>


Small White Linux Learning Tour (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.