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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:46:56+00:00 2026-06-16T12:46:56+00:00

I would like to know the difference between these two lines : sudo sed

  • 0

I would like to know the difference between these two lines :

sudo sed 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=3/' /etc/default/grub >/etc/default/grub

and

sudo sed -i 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=3/' /etc/default/grub

There seems to be a difference because the first returns a Permission denied error while the other doesn’t.

  • 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-16T12:46:57+00:00Added an answer on June 16, 2026 at 12:46 pm

    As @sarathi said, the -i flag modifies the file in-place. The reason you’re getting a permission denied error is because /etc/default/grub is probably only modifiable by root.

    Your first command:

    sudo sed 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=3/' /etc/default/grub >/etc/default/grub
    

    Runs sed as a superuser, which doesn’t do anything useful as sed writes to its stdout. Then it tries to overwrite /etc/default/grub as the current user, which is disallowed.

    In the second command:

    sudo sed -i 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=3/' /etc/default/grub
    

    The file is modified by sed itself, which is running as root.

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

Sidebar

Related Questions

I would like to know is there any difference in performance between these two
I would like to know difference between these two lines: p.intro a{color=# ff99ff;} p
I would like to know what is the difference between these two jQuery selectors:
I would like to know the difference in terms of performance between these two
I would like to know what the difference between these instructions is: MOV AX,
I would like to know if there is a difference in speed between computing
I would like to know the differences between these two types of URLs: relative
Would there be any noticeable speed difference between these two snippets of code? Naively,
I am a newbie....I would really like to know detailed difference between two, and
I would like to know what is the difference between those two categories that

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.