Linux commands: Difference between revisions

Jump to navigation Jump to search
162 bytes added ,  31 May 2014
Line 173: Line 173:


Search text of command output
Search text of command output
* {{kbd | key=''linux command'' <nowiki>|</nowiki> awk '/''string''/'}} ({{Linux}}) 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>
* {{kbd | key=''linux command'' <nowiki>|</nowiki> awk '/''string''/'}} ({{Linux}}) 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 '/zip|unzip/'</nowiki>}} to search the installed package naming ''zip'' or ''unzip'' for Ubuntu.
* {{kbd | key=''linux command'' <nowiki>|</nowiki> grep ''string''}} ({{Linux}}) ex: keyin {{kbd | key=<nowiki>yum list installed | grep tar</nowiki>}} to search the installed package naming tar for CentOS.<ref>[http://alvinalexander.com/unix/edu/examples/grep.shtml Unix/Linux grep command examples | grep command in Unix and Linux | grep examples | alvinalexander.com]</ref>
* {{kbd | key=''linux command'' <nowiki>|</nowiki> grep ''string''}} ({{Linux}}) ex: keyin {{kbd | key=<nowiki>yum list installed | grep tar</nowiki>}} to search the installed package naming tar for CentOS.<ref>[http://alvinalexander.com/unix/edu/examples/grep.shtml Unix/Linux grep command examples | grep command in Unix and Linux | grep examples | alvinalexander.com]</ref>
* {{kbd | key=''Windows command'' <nowiki>|</nowiki> find ''"string"''}} ({{Win}}) ex: {{kbd | key=<nowiki>netstat -a | find "3306"</nowiki>}}  (note:  enclose string in double quotation marks)<ref>[http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find.mspx?mfr=true Microsoft Windows XP - Find]</ref>
* {{kbd | key=''Windows command'' <nowiki>|</nowiki> find ''"string"''}} ({{Win}}) ex: {{kbd | key=<nowiki>netstat -a | find "3306"</nowiki>}}  (note:  enclose string in double quotation marks)<ref>[http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find.mspx?mfr=true Microsoft Windows XP - Find]</ref>

Navigation menu