Linux: How to append contents of multiple files into one


Example we have many html file:

[root@tutorialspots ok]# ls
backup_okru0.html             backup_okru_type_432001.html
backup_okru1001.html          backup_okru_type_432501.html
backup_okru1501.html          backup_okru_type_433001.html
backup_okru2001.html          backup_okru_type_433501.html
backup_okru2501.html          backup_okru_type_434001.html
backup_okru3001.html          backup_okru_type_434501.html
backup_okru3501.html          backup_okru_type_435001.html
backup_okru4001.html          backup_okru_type_43501.html
backup_okru4501.html          backup_okru_type_435501.html
backup_okru5001.html          backup_okru_type_436001.html
backup_okru501.html           backup_okru_type_436501.html
backup_okru5501.html          backup_okru_type_437001.html
backup_okru6001.html          backup_okru_type_437501.html
backup_okru6501.html          backup_okru_type_438001.html
backup_okru7001.html          backup_okru_type_438501.html
backup_okru7501.html          backup_okru_type_439001.html
backup_okru8001.html          backup_okru_type_439501.html
backup_okru8501.html          backup_okru_type_440001.html
backup_okru_type_40.html      backup_okru_type_44001.html
backup_okru_type_410001.html  backup_okru_type_440501.html
backup_okru_type_41001.html   backup_okru_type_441001.html
backup_okru_type_410501.html  backup_okru_type_441501.html
backup_okru_type_411001.html  backup_okru_type_442001.html
backup_okru_type_411501.html  backup_okru_type_442501.html
backup_okru_type_412001.html  backup_okru_type_443001.html
backup_okru_type_412501.html  backup_okru_type_443501.html
backup_okru_type_413001.html  backup_okru_type_444001.html
backup_okru_type_413501.html  backup_okru_type_444501.html
backup_okru_type_414001.html  backup_okru_type_445001.html
backup_okru_type_414501.html  backup_okru_type_44501.html
backup_okru_type_415001.html  backup_okru_type_445501.html
backup_okru_type_41501.html   backup_okru_type_446001.html
backup_okru_type_415501.html  backup_okru_type_446501.html
backup_okru_type_416001.html  backup_okru_type_447001.html
backup_okru_type_416501.html  backup_okru_type_447501.html
backup_okru_type_417001.html  backup_okru_type_448001.html
backup_okru_type_417501.html  backup_okru_type_448501.html
backup_okru_type_418001.html  backup_okru_type_449001.html
backup_okru_type_418501.html  backup_okru_type_449501.html
backup_okru_type_419001.html  backup_okru_type_450001.html
backup_okru_type_419501.html  backup_okru_type_45001.html
backup_okru_type_420001.html  backup_okru_type_4501.html
backup_okru_type_42001.html   backup_okru_type_450501.html
backup_okru_type_420501.html  backup_okru_type_451001.html
backup_okru_type_421001.html  backup_okru_type_451501.html
backup_okru_type_421501.html  backup_okru_type_452001.html
backup_okru_type_422001.html  backup_okru_type_452501.html
backup_okru_type_422501.html  backup_okru_type_453001.html
backup_okru_type_423001.html  backup_okru_type_453501.html
backup_okru_type_423501.html  backup_okru_type_454001.html
backup_okru_type_424001.html  backup_okru_type_454501.html
backup_okru_type_424501.html  backup_okru_type_455001.html
backup_okru_type_425001.html  backup_okru_type_45501.html
backup_okru_type_42501.html   backup_okru_type_455501.html
backup_okru_type_425501.html  backup_okru_type_456001.html
backup_okru_type_426001.html  backup_okru_type_456501.html
backup_okru_type_426501.html  backup_okru_type_457001.html
backup_okru_type_427001.html  backup_okru_type_457501.html
backup_okru_type_427501.html  backup_okru_type_46001.html
backup_okru_type_428001.html  backup_okru_type_46501.html
backup_okru_type_428501.html  backup_okru_type_47001.html
backup_okru_type_429001.html  backup_okru_type_47501.html
backup_okru_type_429501.html  backup_okru_type_48001.html
backup_okru_type_430001.html  backup_okru_type_48501.html
backup_okru_type_43001.html   backup_okru_type_49001.html
backup_okru_type_430501.html  backup_okru_type_49501.html
backup_okru_type_431001.html  backup_okru_type_431501.html

How to join them into one file?

cat *.html > ok.txt

Leave a Reply