14,982
edits
| Line 105: | Line 105: | ||
* vim: (1)[http://www.tuxfiles.org/linuxhelp/vimcheat.html vim] <nowiki>[options]</nowiki> ''filename'' (2)press {{kbd | key= /keyword}} ({{Linux}}) | * vim: (1)[http://www.tuxfiles.org/linuxhelp/vimcheat.html vim] <nowiki>[options]</nowiki> ''filename'' (2)press {{kbd | key= /keyword}} ({{Linux}}) | ||
* cat & grep: {{kbd | key= cat /path/to/file <nowiki>|</nowiki> grep ''keyword''}} | |||
** case insensitive: Using {{kbd | key=<nowiki> cat /path/to/file | grep -i keyword</nowiki>}} ({{Linux}}) or enclose it in double quotes if the keywords contains spaces {{kbd | key=<nowiki>cat /path/to/file | grep -i "keywords contains space"</nowiki> }} | * cat & grep: {{kbd | key= cat /path/to/file <nowiki>|</nowiki> grep ''keyword''}} ({{Linux}})<ref>[https://www.digitalocean.com/community/tutorials/using-grep-regular-expressions-to-search-for-text-patterns-in-linux#regular-expressions Using Grep & Regular Expressions to Search for Text Patterns in Linux | DigitalOcean]</ref> | ||
** case sensitive: {{kbd | key=<nowiki>cat /path/to/file | grep keyword</nowiki>}} | ** case insensitive: Using {{kbd | key=<nowiki> cat /path/to/file | grep -i keyword</nowiki>}} ({{Linux}}) or enclose it in double quotes if the keywords contains spaces {{kbd | key=<nowiki>cat /path/to/file | grep -i "keywords contains space"</nowiki> }} e.g. Keyin {{kbd | key=<nowiki>cat log.txt | grep -i error</nowiki>}} to matched the line contains ''error'' or ''Error'' in the file ''log.txt''. | ||
** case sensitive: {{kbd | key=<nowiki>cat /path/to/file | grep keyword</nowiki>}} ({{Linux}}) | |||
other issues | other issues | ||