2016年8月9日火曜日

sed

[上書き保存]
o Original File保存 -i.org
o 文字列を置換 -e "s/oldstrings/newstrings/"
o File上書き -i

sed -i.org -e "s/ pi --noclear/ PIPI --noclear/" /etc/systemd/system/getty.target.wants/getty@tty1.service



[commnet行削除]
$ sed -e '/^#/d' sample.txt
 
[commnet記号削除] 
$ sed -e 's/^#//' sample.txt

 

0 件のコメント:

コメントを投稿