Shell Usage Small record

Source: Internet
Author: User
Awk:gsub Replacement NETSTAT-TNPL | Gawk ' $NF ~/\/mongod$/{gsub (/.+:/, "", $4);p rint $4} ' |sort-n to replace all $4: End with empty shell array ${#ports [@]} #得出数组长度 ${ports[@]} = ${p Orts[*]} to derive the array value ${ports[@]:8} to get the array after 8 ${ports[@]::8} = ${ports[@]:0:8} to get the array of the first 8 ${ports[@]:1:8} to derive the array 2nd through 9th (take 8)


This article from "Good memory than bad writing" blog, please be sure to keep this source http://goooood.blog.51cto.com/5060201/1603935

Shell Usage Small record

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.