「Linux」catコマンドで複数のファイルを連結する方法

2021年3月18日

書式
cat ファイル1 ファイル2 >ファイル3
cat ファイル1>>ファイル2
使用例
# cat test1.txt
aa
bb
# cat test2.txt
cc
dd

ファイルを連結
方法1
# cat test1.txt test2.txt > test3.txt
# cat test3.txt
aa
bb
cc
dd
方法2
# cat test2.txt>>test1.txt
# cat test1.txt
aa
bb
cc
dd

Linux

Posted by arkgame