sed -i 's#修改前#修改后#' 文件名
例如:
sed -i 's#99999#180#' /etc/login.defs
往某个文件具体的某一行插入内容
例如往a.txt的第15行插入内容"abc"
sed -i "15i abc" a.txt
转载于:https://blog.51cto.com/406647516/1773080
sed -i 's#修改前#修改后#' 文件名
例如:
sed -i 's#99999#180#' /etc/login.defs
往某个文件具体的某一行插入内容
例如往a.txt的第15行插入内容"abc"
sed -i "15i abc" a.txt
转载于:https://blog.51cto.com/406647516/1773080