command line - Writing to multiple files with cat - Ask Ubuntu


i have empty html files want write. trying this

cat account_settings/account_settings.html >> assets/assets.html, users/users.html 

to attempt write files assets.html , users.html.

how can write multiple files?

you can use tee command

name        tee - read standard input , write standard output , files 

e.g.

cat account_settings/account_settings.html | tee -a assets/assets.html users/users.html 

or (using input redirection)

tee -a assets/assets.html users/users.html < account_settings/account_settings.html 

as noted in manual page, tee outputs contents terminal (standard output) - if don't want see that, redirect stdout null

tee -a assets/assets.html users/users.html < account_settings/account_settings.html > /dev/null 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User