Linux下sedコマンド使用全解析
#sed-eコマンドライン処理-a新規
> sed -e '$ a widuu' test.txt#はtest.txtの末尾にwiduuを追加
コードのコピー
#-eを-nに変更
> sed -n '$ a widuu' test.txt#処理された行のみ表示
コードのコピー
#-cはどれだけの行為を置き換えますか?あなたが作った文字列、ここで私のtest.txt内容は図のように
> sed -e '2,5c xiaowei' test.txt#2-5行を文字列xiaoweiに置き換える
コードのコピー
#マルチコマンド実行-e
> sed -e '2,5c xiaowei' -e 's/cccc/widuu/' test.txt
コードのコピー
#-i出力しない-s置換