14,954
edits
| Line 277: | Line 277: | ||
=== Search and extract string from command output === | === Search and extract string from command output === | ||
* {{kbd | key=''linux command'' <nowiki>|</nowiki> awk '/''string''/'}} ({{Linux}}) ex: | * {{kbd | key=''linux command'' <nowiki>|</nowiki> awk '/''string''/'}} ({{Linux}})<ref>[https://unix.stackexchange.com/questions/393948/how-to-search-and-extract-string-from-command-output shell script - How to search and extract string from command output? - Unix & Linux Stack Exchange]</ref> ex: | ||
** keyin {{kbd | key=<nowiki>dpkg --get-selections | awk '/tar/'</nowiki>}} to search the installed package naming ''tar'' for Ubuntu.<ref>[http://www.linuxquestions.org/questions/linux-newbie-8/logical-operators-in-grep-775595/ logical operators in grep]</ref> | ** keyin {{kbd | key=<nowiki>dpkg --get-selections | awk '/tar/'</nowiki>}} to search the installed package naming ''tar'' for Ubuntu.<ref>[http://www.linuxquestions.org/questions/linux-newbie-8/logical-operators-in-grep-775595/ logical operators in grep]</ref> | ||
** keyin {{kbd | key=<nowiki>dpkg --get-selections | awk '/zip|unzip/'</nowiki>}} to search the installed package naming ''zip'' or ''unzip'' for Ubuntu. | ** keyin {{kbd | key=<nowiki>dpkg --get-selections | awk '/zip|unzip/'</nowiki>}} to search the installed package naming ''zip'' or ''unzip'' for Ubuntu. | ||