Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:39:18+00:00 2026-05-26T04:39:18+00:00

I have a file r . I want to replace the words File and

  • 0

I have a file r. I want to replace the words File and MINvac.pdb in it with nothing. The commands I used are

sed -i 's/File//g' /home/kanika/standard_minimizer_prosee/r

and

sed -i 's/MINvac.pdb//g' /home/kanika/standard_minimizer_prosee/r

I want to combine both sed commands into one, but I don’t know the way. Can anyone help?

The file looks like this:

-6174.27    File10MINvac.pdb
-514.451    File11MINvac.pdb
4065.68     File12MINvac.pdb
-4708.64    File13MINvac.pdb
6674.54     File14MINvac.pdb
8563.58     File15MINvac.pdb
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:39:18+00:00Added an answer on May 26, 2026 at 4:39 am

    sed is a scripting language. You separate commands with semicolon or newline. Many sed dialects also allow you to pass each command as a separate -e option argument.

    sed -i 's/File//g;s/MINvac\.pdb//g' /home/kanika/standard_minimizer_prosee/r
    

    I also added a backslash to properly quote the literal dot before pdb, but in this limited context that is probably unimportant.

    For completeness, here is the newline variant. Many newcomers are baffled that the shell allows literal newlines in quoted strings, but it can be convenient.

    sed -i 's/File//g
        s/MINvac\.pdb//g' /home/kanika/standard_minimizer_prosee/r
    

    Of course, in this limited case, you could also combine everything into one regex:

    sed -i 's/\(File\|MINvac\.pdb\)//g' /home/kanika/standard_minimizer_prosee/r
    

    (Some sed dialects will want this without backslashes, and/or offer an option to use extended regular expressions, where they should be omitted. BSD sed, and thus also MacOS sed, demands a mandatory argument to sed -i which can however be empty, like sed -i ''.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file that contains this <!-- CordovaVersion --> I want to replace
I have the local file path as c:\new folder\pdf\today\k.pdf I want to replace the
HI, I have some string from XML file, and I I want to replace
I have a filter bad words codes below I want to replace this ARRAY
I have KML file and I want to read this file and to do
I have a JSON file and want to parse value of variable second value
I have a file that I want to import into Microsoft Dynamics CRM 2011
I have a large file I want to download from a server I have
I have a file that I want to deploy when my web project (an
I have a CSV file I want to load at boot of my Lift

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.