あるファイルの最初の7行を別のファイルの内容に置き換えます。

あるファイルの最初の7行を別のファイルの内容に置き換えます。

2つのファイルがあります。一つは吠えてfile1.txt、もう一つはperson1.txt。次の例に示すように、すべて数行のテキストが含まれています。

  • file1.txt
    word1
    word2
    word3
    word4
    word5
    word6
    word7
    word8
    word9
    
  • person1.txt
    givi sixarulidze
    

私がしたいことは、コードfile1.txtの最初の7行をperson1.txt

  • 希望の出力:
    givi sixarulidze
    word8
    word9
    

どうすればいいですか?

ベストアンサー1

cp person1.txt result.txt
tail -n+8 file1 >> result.txt

おすすめ記事