Linuxçã§ããã¡ã¤ã«ã®ç¹å®ã®è¡ã«ãããæååãæ¿å ¥(追å )ãããæã®ã³ãã³ã(sed)ãµã³ãã«ãåå¿é²çã«ã åæ ãããªãã¡ã¤ã«ãããã¾ãã $ cat test.txt line1 line2 line3 2è¡ç®ã«æ¿å ¥ $ sed -e "2i hoge" test.txt line1 hoge line2 line3 2è¡ç®ç´ä¸ã«æ¿å ¥ $ sed -e "2a hoge" test.txt line1 line2 hoge line3 "line2"ã®è¡åã«æ¿å ¥ â»ãã®è¾ºã®æ£è¦è¡¨ç¾ã¯ãè¦ä»¶ã«å¿ãã¦é©å½ã«å¤ãã¦ã¼ã $ sed -e "/^line2$/i hoge" test.txt line1 hoge line2 line3 "line2"ã®è¡å¾ã«æ¿å ¥ $ sed -e "/^line2$/a hoge" test.txt line1 line2 hoge line3 sed
{{#tags}}- {{label}}
{{/tags}}