1
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"

参考文档

  1. [https://stackoverflow.com/questions/17998978/removing-colors-from-output]