How to remove pattern from line but return what remains?

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question





















  • This is more of a task for sed or awk
    – glenn jackman
    15 mins ago














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?










share|improve this question





















  • This is more of a task for sed or awk
    – glenn jackman
    15 mins ago












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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 18 mins ago









GreNIX

507




507











  • 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




This is more of a task for sed or awk
– glenn jackman
15 mins ago















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

Peggy Mitchell

The Forum (Inglewood, California)

Palaiologos