This question already has an answer here:
- Can't redirect cut output 1 answer
I wanted to grep some logs, while tailing them, and print only a part of each line, since the lines are too long.
I can't figure out why the combination I use doesn't work; the procedure follows:
echo 'Jun 29 16:27:00 someip rails[pid]: Killed a transaction Jun 29 16:28:00 someip rails[pid]: Killed a transaction' > /tmp/test # Shows the lines tail -f /tmp/test | grep Killed # Shows the lines grep Killed /tmp/test | cut -c -43 # Shows the lines cat /tmp/test | grep Killed | cut -c -43 # Doesn't show them tail -f /tmp/test | grep Killed | cut -c -43
Why doesn't the last combination work?