Please spend a few second. i would like to delete the line which has the sixth <ul> occurance.
i google the way of doing it and i tried
sed -i '/^<ul>$/ d/6' file .
However, it turn out a
sed: -e expression #1, char 9: extra characters after
error.
AFAIK you can’t do that easily with
sed. You can do that like joining all the lines to one string, then delete that 6th occurence, then split the string, but it’s easier withawk:Test results are here: https://ideone.com/3YpVu
Note: it discards the whole line with the 6th
<ul>, and assumes that there are only one<ul>can be found per line.HTH