Linux Systems and commands

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


a system Architecture of Linux

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 startup

/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

two management of files

1) creation of files and directories

Touch + filename

A reminder is that you can use "{}" in the middle of the two "." instead of three,

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" width= "414" height= "326" alt= "Spacer.gif"/>

mkdir + filename ( the established directory cannot have spaces between the paths )

-P Parent directory does not exist automatically established

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd," width= "554" height= "alt=

1) Delete Files

Rm-f forcibly removed without prompting

-R Delete directory

all of these parameters in Linux can be written together.

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/ Default/images/word.gif ") no-repeat center;border:1px solid #ddd," width= "554" height= "alt=

2) vim text mode edit File

Vim filename goes into command mode , Command mode cannot edit the file, if you want to edit the 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

can also be used! q Force quit does not save,

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/ Default/images/word.gif ") no-repeat center;border:1px solid #ddd;" Width= "309" height= "+ alt=" Spacer.gif "/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/ Default/images/word.gif ") no-repeat center;border:1px solid #ddd;" Width= "" height= ", alt=" Spacer.gif "/>

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

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/ Default/images/word.gif ") no-repeat center;border:1px solid #ddd;" Width= "103" height= "-alt=" Spacer.gif "/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" width= "335" height= "" alt= "and" Spacer.gif "/>

4) switch work environment CD command : represents a parent directory . represents the current directory

CD-# # switch working directory to previous directory

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" width= "401" height= "" alt= "," Spacer.gif "/>

CD ~ # # Switch to your home directory

CD ~usernmae # # switch to the specified user home directory

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" width= "249" height= "" alt=, "Spacer.gif"/>

Cd.. # # go to the parent directory of the current directory

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" Width= "260" height= "+ alt=" Spacer.gif "/>

5)MV(MV of the same disk is renamed, the MV of different disks is the copy deletion process)

in the bottom of the picture I made a very low-level error caused file2 and File3 did not succeed, come out for everyone to enjoy

the right way for MV +filename + target

MV file File1 direcotry # # Move file file1 into directory

MV exists file does not exist file # # Rename file

MV Westos/linux. # # move Linux in Westos to the current directory . "Previous directory

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" width= "493" height= "" alt=, Spacer.gif "/>

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" Width= "507" height= "alt=," Spacer.gif "/>

6)cp file Copy command

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" width= "494" height= "" alt= "," Spacer.gif "/>

7) LS lists directory or file information

LS direcory|filename # # list file or directory contents

Ls-ld Directory # # # Lists the properties of the catalog itself

Ls-r the contents of the directory ( note that the file~ file represents hidden, although not visible, but can be viewed through the LS command )

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" width= "386" height= "" alt=, Spacer.gif "/>

Ls–a Displays all content in the directory, including the "." hidden files at the beginning

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/ Default/images/word.gif ") no-repeat center;border:1px solid #ddd;" width= "381" height= "to" alt= "Spacer.gif"/>

Ls-l filename|dorectory Lists the properties of the contents of a file or directory

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" width= "430" height= "alt=

ls-d direcotry List the directory itself

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/ Default/images/word.gif ") no-repeat center;border:1px solid #ddd;" width= "378" height= "to" alt= "Spacer.gif"/>

Ls If there is no target behind then the default target is the current directory

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/ Default/images/word.gif ") no-repeat center;border:1px solid #ddd;" width= "356" height= "alt=" Spacer.gif "/>

8) Regular Expressions

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" Width= "519" height= "108" alt= "Spacer.gif"/>

* Match 0 to any character

? match a single character

[[: Alpha:]] match a single letter

[[: Lower:]] match a single lowercase letter

[[: Upper:]] match a single uppercase letter

[[:d Igit:]] match a single number

[[: Alnum:]] match 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; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/themes/ Default/images/word.gif ") no-repeat center;border:1px solid #ddd;" width= "346" height= "-alt=" Spacer.gif "/>

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

{A.. F} # # #a-F

{1,3,5} # # #135

{a,c,e} # # #ac E

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

[] indicates the existence of the

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" width= "554" height= "162" alt= "Spacer.gif"/>

[A-c] # # #aAbB CC

[A-c] # # #aA or BB or C

[1-3] # # #1 or 2 or 3

[145] # # #1 or 4 or 5

[^abc]| [!ABC] # # # except for a and b and except C


This article is from the "13345576" blog, please be sure to keep this source http://13355576.blog.51cto.com/13345576/1969299

Linux Systems and commands

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.