sed -i 's#修改前#修改后#' 文件名

例如:

 sed -i 's#99999#180#' /etc/login.defs 


往某个文件具体的某一行插入内容

例如往a.txt的第15行插入内容"abc"

sed -i "15i abc" a.txt