Common shell skills

Source: Internet
Author: User

Let's take a look at some common shell tips.

CTRL + u Delete the cursor to the beginning of the current row

CTRL + k Delete the cursor position to the end of the current row

CTRL + a move the cursor to the beginning of the current row

CTRL + e move the cursor to the end of the current row

!! Repeat the previous command

Which executable file path search

Find [path] [parameter] [expression]

Find/etc/-name passwd find the passwd file under/etc

Find.-Name '*. conf'-exec CP {}{}. orig \; find all. conf files in the current directory and copy them. Add. orig to the filename suffix. ({} Is the search result, \; indicates that the command is terminated)

Find is very powerful, you can try it by yourself, various parameters-ctime,-user,-Perm,-type... and so on

Grep-I case-insensitive

-N print the row number

-V reverse matching

-A 5: displays the first five rows of the row.

-B 5: The last five rows of the row are displayed.

Awk-f \ t' {print $0> FILENAME "." $2} 'file is divided into multiple files by the second column

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.