The sed command must be added with-I?

for example

sed "41a Port 22520" /etc/ssh/ssh_config

the result file does not change until-I is added.

Thank you. I"m always confused about this kind of stuff.

Dec.30,2021

you don't necessarily need to add-I, it depends on your purpose.
as in your case, adding-I will modify the original file. In many cases, there is no need to modify the original file, so there is no need to add-I.

-I: directly modify the contents of the read file, rather than output from the screen.


man sed you'll understand

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36ff4-2c050.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36ff4-2c050.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?