Jump to content
  • 0

sed src/xxx/yyy/aaa replace to src/xxx


1 answer to this question

Recommended Posts

  • 0
29 minutes ago, dtaara said:



Please can anyone help me how to sed and replace 

src/xxx/yyy/aaa and replace to src/xxx ?




Let's take the string hello world world for an example.

You can replace a single instance of world to Bob as follows:

$ echo 'hello world world' | sed 's/world/Bob/'



If you want to replace all instance of world to Bob, then add a g flag at the end of sed expression as follows:

$ echo 'hello world world' | sed 's/world/Bob/g'



That's the basics of sed. I hope this helps.

If you have any questions, fell free to ask. 




Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...