How to Solve sed -i error:
sed -i.bak '/.*CMDLINE_LINUX.*/s#(.*)"#\1 net.ifnames=0"#' /etc/default/grub
always report the error: sed: -e expression #1, char 44: invalid reference \1 on `s’ command’s RHS
sed -i -r '/.*CMDLINE_LINUX.*/s#(.*)"#\1 net.ifnames=0"#' /etc/default/grub
Later we know that you need to add -r, because there is a backward reference – \1, and -i and -r should be written separately