Linux/Unix:Find and Replace: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 1: | Line 1: | ||
[[Category: | [[Category:Linux/Unix]] | ||
==cat== | ==cat== | ||
Revision as of 06:33, 22 May 2019
cat
head tail
fold
strings
more less
tr
- tr "[:upper:]" "[:lower:]"
- tr "[abc]" "[xyz]"
- Transtlate, make all lowercase
- replace all a's with y, all b's with y and all c's with z, works from stdin to stdout. All sort of translations can be done
- tr -d <char>
- Delete <char> from standard input
grep
sed
- s/pattern/newstring/
- In each line replace first occurrence of pattern with newstring. /g at the end replaces all occurrences of pattern.
- s/pattern/d
- Delete each line matching pattern.