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
Post a Comment