问题描述
例如,我可能想:
tail -f logfile | grep org.springframework | <command to remove first N characters>
我在想 tr
可能有能力做到这一点,但我不确定.
I was thinking that tr
might have the ability to do this but I'm not sure.
推荐答案
使用cut
.例如.去除每行的前 4 个字符(即从第 5 个字符开始):
Use cut
. Eg. to strip the first 4 characters of each line (i.e. start on the 5th char):
tail -f logfile | grep org.springframework | cut -c 5-