User Tools

Site Tools


grep

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

grep [2023/08/01 18:27] – created stevegrep [2026/04/10 21:56] (current) steve
Line 1: Line 1:
 ==== Grep commands to do various things... ==== ==== Grep commands to do various things... ====
-  * grep -v '^\s*$\|^\s*\#'   Removes comments and blank lines+  * ''%% grep -v '^\s*$\|^\s*\#' %%'  Removes comments and blank lines 
 +  * ''%% grep '^r......ing$' /usr/share/dict/words %%''  Get all of the 10 letter words starting with an r and ending in ing. 
 +  * The caret(^) marks the beginning of a line, the dollar ($) marks the end. 
 +<code> 
 +# Get all the seven letter words that start with a vowel, have a vowel in the fifth position and an r in the seventh position. 
 +grep -E '^[aeiou]...[aeiou].r$' /usr/share/dict/words 
 +amateur 
 +angrier 
 +artsier 
 +atelier 
 +earlier 
 +emptier 
 +itchier 
 +opaquer 
 +outdoor 
 +outwear 
 +unclear 
 +uniquer 
 +untruer 
 + 
 +# And this is 'Words that start with two vowels, then two of anything, another vowel, and end in an r'. 
 +grep -E '^[aeiou]{2}..[aeiou]r$' /usr/share/dict/words 
 +airier 
 +author 
 +earner 
 +easier 
 +eerier 
 +either 
 +oilier 
 +ouster 
 +</code>
grep.txt · Last modified: by steve