get a part of a line after grep
cut
must do the job
grep something somewhere | grep againsomething | cut -f2 -d' '
Use awk(1)
:
awk ' { print $2" "substr($0,length($0)-8) }'
cut
must do the job
grep something somewhere | grep againsomething | cut -f2 -d' '
Use awk(1)
:
awk ' { print $2" "substr($0,length($0)-8) }'