diff options
author | Gregory S. Kielian <gregory.kielian@gmail.com> | 2014-09-27 12:04:25 -0700 |
---|---|---|
committer | Gregory S. Kielian <gregory.kielian@gmail.com> | 2014-09-27 12:04:25 -0700 |
commit | b52a32dd2439c293892b72e35b57b4887a5a53cf (patch) | |
tree | 77175de04b06c35c4d893cabef935a27ec4325f5 /bash.html.markdown | |
parent | 66f62c63cad4fa100ddc13368486538e0b7dd797 (diff) |
Added `sed` and `grep` examples to useful-commands
Diffstat (limited to 'bash.html.markdown')
-rw-r--r-- | bash.html.markdown | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bash.html.markdown b/bash.html.markdown index dc7d32b6..0f571e83 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -9,6 +9,7 @@ contributors: - ["akirahirose", "https://twitter.com/akirahirose"] - ["Anton Strömkvist", "http://lutic.org/"] - ["Rahil Momin", "https://github.com/iamrahil"] + - ["Gregrory Kielian", "https://github.com/gskielian"] filename: LearnBash.sh --- @@ -199,4 +200,8 @@ sort file.txt uniq -d file.txt # prints only the first column before the ',' character cut -d ',' -f 1 file.txt +# replaces every occurance of 'apples' with 'oranges' in file.txt +sed -i 's/apples/oranges/g' file.txt +# prints the number of occurances of "foo" in file.txt +grep -c "foo" file.txt ``` |