Linux Common Command Collation (v): Shell Basics

Source: Internet
Author: User

Hello everyone, I'm a singing program, ape ~~~~~~.

Recently in the study of Linux, spare time on these basic commands to organize, I hope you can use, the purpose of the finishing is to forget when the turn out to see ^?_?^, before and after a total of five parts:

Linux Basic Command Collation (a): Common commands

Address: http://www.cnblogs.com/devinCat/p/7247824.html

Linux basic commands Collation (ii): Users, user groups, file systems, and networks

Address: http://www.cnblogs.com/devinCat/p/7247847.html

Linux basic commands Collation (iii): Process and Vim

Address: http://www.cnblogs.com/devinCat/p/7247883.html

Linux Common Command Collation (iv): package Management and Shell basics

Address: http://www.cnblogs.com/devinCat/p/7247911.html

Linux Common Command Collation (v): Shell Basics

Address: http://www.cnblogs.com/devinCat/p/7247926.html

Hope to be useful to everyone, welcome comments Exchange

Linux common commands (v)

--------------Shell Basics

Pipe command: "|", separating the two commands, the output of the pipeline negative left command will be input to the command on the right of the pipe character

such as: PS Aux|grep java

Find: Search for a file in a directory (and its subdirectories)

-path: Follow the path of the file to find

-print: Output a matching file in the console

-name: Search by file name

-perm: Follow the file's permissions to find

-user: Follow the file owner to find

-group: Find files according to the group to which the files belong

-mtime-n +n: According to file change time to find the file,-n means that the file change time is now less than n days, +n is the file more love time distance now n days ago

such as: Find-mtime-3 or +5

-nogroup: View the file of the invalid owning group, which does not exist in/etc/groups

-type: Finding a file of a certain type

B: Block device files

D: Catalogue

C: Character device file

P: Pipeline File

|: Symbol Connection File

F: Normal file

Find/etc-type L-print

-size N:[c] According to file length n file, with C for file length in bytes

Find. -size +1000c-print

SED: non-interactive text processing tool

H: Show Help

N: Show only results after script is processed

V: Display version information

E: Allow the input data to be edited using multiple SED commands

F: unmount the action of SED directly within a file,

S: String substitution

I: Insert

D: Delete

A: Append

C: Replace

P: Print the specified output line

grep: Full search, regular expression matching shows the book out

-N: Simultaneous display of rows of rows up and down the matching row

-B: Prints the block number where the line is printed before the match line

-C: Prints only the number of rows that match the row and does not display matching content

-F: Extracting templates from files

-H: The matching filename prefix is not displayed when searching multiple files

-I: Ignoring case differences

-Q: Suppress the display, returning only the exit status

-V: Anti-retrieval, showing only rows that do not match

Tail: The last few lines of a document file are displayed on the middle end, and if the file is updated, tail automatically refreshes to make sure you see the latest Ask price content

-F: This parameter is used to monitor file growth

-C Number: Reads a file from the number byte location

-N Number: reads the specified file from the number line location

-M Number: reads a file from the multiple-byte character location

-B Number: reads the specified file from the 512-byte block location of Number apprentice

-K Number: reads the specified file from the 1K location represented by number

such as: Tail? -N-filename

Displays the last 20 lines of the filename.

Sort: Sort by character by default

-N: Sort by value

-U: Duplicate rows do not appear

-T: Specify the symbol for the segment

-K: The number of paragraphs specified

-R: Reverse Sort

such as; Sort-t "."-K 4 Demo

Cut: Cut data in a file

-B: bytes

-C: Character

-F: Extract the first few columns

-D: Split columns by specified delimiter

such as: After the nineth byte cut-b 9-demo

such as: Before the nineth byte Cut-b-9 Demo

For example, get the first field cut-d with a dot delimiter. -F 1 Demo

History: Show All Histories

History 5: Show the last five commands executed

!! ? Run the previous command

!88? Run the 88th command

!88? /test? Run the 88th command and add/test after the command?

!? Cf?? Run the previous command containing a CF string???

!ls running the previous LS command

!ls:s/cf/l? Run the previous LS command, where the CF is replaced with l?

Fc? Edit and run the previous history command

Fc? 66? Edit and run a 66th history command

Fc? -e? /usr/bin/vim? 66? Use Vim to edit a 66th command and run

Linux Common Command Collation (v): Shell Basics

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.