Linux/Parsing: Difference between revisions
< Linux
(→lines) |
(→lines) |
||
Line 3: | Line 3: | ||
<blockquote> | <blockquote> | ||
<pre> | <pre> | ||
grep -v | grep -v ^$ # remove empty lines | ||
</pre> | </pre> | ||
</blockquote> | </blockquote> |
Revision as of 15:11, 4 August 2020
lines
- grep
grep -v ^$ # remove empty lines
- tail
tail tail -f # follow tail -n 10 # last 10 lines tail +3 # skip first 3 lines
- wc
wc -l # count lines
chars
- cut
- tr
sed & awk
- sed + control characters
sed 's/\x00/controlcharwashere/g'
sed -n '/Iowa/,/Montana/p'
other
- slowing output
cat incoming.log | pv -qL 1000 | tee temp
- show as hex
od -t x1 -An