I wanted to find out how many urls were written in sitemap.xml without line breaks that were too big, so I tried it quickly with a Linux command.
Insert a line feed code after </ url>
and check the number of lines to make a judgment.
Even if I try to insert \ n
to output the line feed code in the output of sed, the character n
appears, so I ended up inserting the line feed itself from the command line. It won't work unless you enclose it in single quotes instead of double quotes. Don't forget the \
before the line break.
$ cat sitemap.xml | sed -e 's/<\/url>/<\/url>\
/g' | wc -l
The number -1 that came out should be the number of urls.
Recommended Posts