Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ファイル1:
dsf sdfsd dsfsdf
ファイル2:
sdfsdfsd sdfsdsdfsdf dsfsdfsdfsdf
2つのファイルを水平方向にキャットしたいので、結果は次のようになります。
dsf sdfsdfsd sdfsd sdfsdsdfsdf dsfsdf dsfsdfsdfsdf
ありがとう
pasteこのコマンドは次のように使用できます。
paste
paste file1 file2
デモ:
$ cat file1 1 2 3 $ cat file2 3 4 5 $ paste file1 file2 1 3 2 4 3 5 $
区切り文字として使用されるデフォルトの文字はタブです。他の文字にスペースを表示させたい場合は、次のように-dオプションを使用できます。
-d
paste -d ' ' file1 file2