How to remove pattern from line but return what remains?

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
If I run ip addr sho | grep 9000 it returns the interface that I need quick stats for:
eth3: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 9000 qdisc mq state UP qlen 1000
However, I'd like to learn how to make this grep command return a shorter line without the unnecessary details, like:
eth3: mtu 9000 state UP
Can this be accomplished with certain parameters applied to the grep command?
grep
add a comment |Â
up vote
0
down vote
favorite
If I run ip addr sho | grep 9000 it returns the interface that I need quick stats for:
eth3: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 9000 qdisc mq state UP qlen 1000
However, I'd like to learn how to make this grep command return a shorter line without the unnecessary details, like:
eth3: mtu 9000 state UP
Can this be accomplished with certain parameters applied to the grep command?
grep
This is more of a task for sed or awk
â glenn jackman
15 mins ago
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
If I run ip addr sho | grep 9000 it returns the interface that I need quick stats for:
eth3: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 9000 qdisc mq state UP qlen 1000
However, I'd like to learn how to make this grep command return a shorter line without the unnecessary details, like:
eth3: mtu 9000 state UP
Can this be accomplished with certain parameters applied to the grep command?
grep
If I run ip addr sho | grep 9000 it returns the interface that I need quick stats for:
eth3: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 9000 qdisc mq state UP qlen 1000
However, I'd like to learn how to make this grep command return a shorter line without the unnecessary details, like:
eth3: mtu 9000 state UP
Can this be accomplished with certain parameters applied to the grep command?
grep
grep
asked 18 mins ago
GreNIX
507
507
This is more of a task for sed or awk
â glenn jackman
15 mins ago
add a comment |Â
This is more of a task for sed or awk
â glenn jackman
15 mins ago
This is more of a task for sed or awk
â glenn jackman
15 mins ago
This is more of a task for sed or awk
â glenn jackman
15 mins ago
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476101%2fhow-to-remove-pattern-from-line-but-return-what-remains%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
This is more of a task for sed or awk
â glenn jackman
15 mins ago