Recent linux commands grep, awk, cut, uniq, wc Practical Application examples

Source: Internet
Author: User
Recently, the linux commands grep, awk, cut, uniq, wc are used to calculate the number of players who use commands every day. comgzip-c-dnohup.out. 'date + % Y % m % d '*. gz | grep/web/api/logic/logicDispatcher | awk & amp; #39; {FS & quot; & amp
Recently learned linux commands grep, awk, cut, uniq, wc. the actual application example shows the number of players who use commands every day: www.2cto.com gzip-c-d nohup. out. 'date + % Y % m % d '*. gz | grep/web/api/logic/logicDispatcher | awk '{FS = "&"; print $2 ;}' | awk' {FS = "= "; print $2;} '| cut-d ''-f3 | cut-d'/'-f2 | sort | uniq | wc-l resolution: gzip-c-d nohup. out. 'date + % Y % m % d '*. gz decompress the zip file, but keep the zip file. output it to the grep/web/api/logic/logicDispatcher console to find the row awk with the keyword '{FS = "&"; print $2;} 'returns the awk account according to the format & {FS = "="; print $2 ;} 'separate accounts by format = '| cut-D'-f3 | cut-D'/'-f2 | sort the first two or three characters of the account in uniq order | wc -l retrieve the unique, then, query the FA and FB usage by Count gzip-c-d nohup. out. 'date + % Y % m % d '*. gz | grep cmd = fa | wc-lgzip-c-d nohup. out. 'date + % Y % m % d '*. gz | grep cmd = fb | wc-l query the amount of game coins consumed by FB grep ___ 23 ___ logs/logclient. log_201211 * | awk '{FS = "_"; all + = $12-$15; print $5, $12, $15, $12-$15, all ;} 'query the total number and type of dropped items grep logGiftItemBymobile logs/logclient. log _ 'date + % Y % m % d '. log | grep consume. refreshtavern.1 | wc-lgrep logGiftItemBymobile logs/logclient. log _ 'date + % Y % m % d '. log | grep hero. reset.1 | wc-lgrep logGiftItemBymobile logs/logclient. log _ 'date + % Y % m % d '. log | grep consume.1.a | wc-lgrep logGiftItemBymobile logs/logclient. log _ 'date + % Y % m % d '. log | grep player. box. gambling.3 | wc-lgrep logGiftItemBymobile logs/logclient. log _ 'date + % Y % m % d '. log | grep player. queue. building | wc-lgrep logGiftItemBymobile logs/logclient. log _ 'date + % Y % m % d '. log | grep equipment. tech. upgrade. book1 | wc-lgrep logGiftItemBymobile logs/logclient. log _ 'date + % Y % m % d '. log | grep enhanced. star.1 | wc-lgrep logGiftItemBymobile logs/logclient. log _ 'date + % Y % m % d '. log | grep enhanced. star.2 | wc-l
 
Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.