Add new lines to top and bottom of every text file
问题 I have a folder that contains about 2000 text files in it. At the top of every file I need these two lines added: <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> And at the bottom of each file I need this added: </urlset> Is there any way to massively do this across all the files at once via command line? Thanks in advance! 回答1: $ cat header <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> $