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?
sed -i.bak 's/ISSUE/NOTICE/g' /var/log/payments.log
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 in the 'sed' command do?
Open an interactive chat with Bash
What is the function of the 's/ISSUE/NOTICE/g' pattern used in 'sed'?
Open an interactive chat with Bash
Why is 'awk' or 'perl' not suitable for this task compared to 'sed -i.bak'?