Which command using a stream editor edits /var/log/payments.log in place, creates a backup with a .bak extension, and replaces every uppercase alert tag with a less alarming label?
The -i.bak option tells the stream editor to modify the file directly and save the original with a .bak suffix. The s/ISSUE/NOTICE/g pattern performs a global replacement of every alert tag. Redirecting output without -i would not alter the original file, omitting the backup suffix would leave no saved copy, and awk or perl solutions either lack built-in backup support or use different syntax for backup creation.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the -i.bak option do in the sed command?
Open an interactive chat with Bash
What is the purpose of the s/ISSUE/NOTICE/g pattern in sed?
Open an interactive chat with Bash
Why would one use a stream editor like sed instead of awk or perl for this task?