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

Windows XP installation, no previous version of Windows NT - Super User

crash - Windows Rundll32 (child process of DllHost) is crashing. How can I even identify it? - Super User

debian - Kali Linux - Debootstrap error Failed to determine codename for the release - Super User