講師Xこと鯨井貴博です音譜


catコマンド
-------
catコマンドは、ファイルの内容を標準出力へ出力したり、
複数ファイルの内容を連結(concatenate)し出力することが出来ます。


実行結果
-------
①ファイル内容を標準出力へ出力および連結
[root@lppc21 test]# cat t1
t1
[root@lppc21 test]# cat t2
t2
[root@lppc21 test]# cat t3
t3
[root@lppc21 test]# cat t1 t2 t3
t1
t2
t3
②-n(全ての行に行番号)、-b(空行以外に行番号)オプションの併用
[root@lppc21 test]# cat testfile
This is a testfile.
Created by Zeus-Learning-Power

*******
[root@lppc21 test]# cat -b testfile
1 This is a testfile.
2 Created by Zeus-Learning-Power

3 *******
[root@lppc21 test]# cat -n testfile
1 This is a testfile.
2 Created by Zeus-Learning-Power
4 *******