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 8718237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:29:38+00:00 2026-06-13T06:29:38+00:00

I know how to find and replace a section in a config file like

  • 0

I know how to find and replace a section in a config file like this:

sudo sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 3M/" /etc/php5/cgi/php.ini

But how do I add a whole new section to the end of the config file within the bash script?

server {
    listen      xx.xx.xx.xx:80;                # your server's public IP address
    server_name  myapp.com;                   # your domain name
    root         /usr/share/nginx/www/myapp/;  # absolute path to your WordPress installation    
}

I tried this within the terminal echo "server { ... }" >> nginx.conf but I get a

-bash: nginx.conf: Permission denied

Not sure if this would be ok within the bash script or I would get a permission denied again…

  • 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-06-13T06:29:39+00:00Added an answer on June 13, 2026 at 6:29 am

    You are using the right syntax.

    echo "....." >> ngix.conf
    

    Just make sure you have the correct write permissions for ‘ngix.conf’.

    -bash: nginx.conf: Permission denied

    This indicates that you have no write privileges.

    You can also write the section in an single file like ‘new_section.txt’ and late add it with:

    cat new_section.txt >> ngix.conf
    

    However I would not advise to add configurations to ngix in this way.
    You can use the ‘include’ statement.

    include you_conf_path/my_new_config.conf;
    

    This way you can group the configuration and have some small config files and not one huge file. Then you can also name your file in a way that helps you find the right one.

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

Sidebar

Related Questions

As you might know,Visual Studio's Find and Replace feature allows us to use Regular
I want to remove all statements like .setText() in eclipse IDE by find/replace (CTRL+F).
I have to do some find and replace tasks on a rather big file
I'm looking for the best approach for string find and replace in Java. This
I know about the Vim find and Replace command, but I find MacVim's Find
I have a pipe delimited string like this: blah|blah|blah|blah|blah|blah|blah|blah|blah|oldDate|blah|blah| I would like replace the
I know I can do a find /replace by searching: Current Document Current Project
I am looking to develop/locate a find-replace tool for XPS documents. Does anyone know
I'm trying to use the freeware Multiple Find And Replace 1.00 suggested in this
The only way I know is: find /home -xdev -samefile file1 But it's really

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.