LoginSignup
0
0

More than 5 years have passed since last update.

sedコマンドメモ

Posted at

1行目に文字列を追加

sample.com
$sed -i '1s/^/line to insert\n/' test.txt

1行目を削除

sample.com
$sed -e '1d' test.txt

最後の行を削除

sample.com
$sed -e '$d' test.txt

htmlタグを消す

sample.sh
$ sed 's/<[^>]*>//g'

空白削除

$ sed 's/ //g'

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0