нашел ответ в Регулярное выражение, которое соответствует действительным адресам IPv6 -bash-4.1 $ egrep '(([0-9a-fA-F] {1,4}:) {7,7} [0-9a-FA-F] {1,4} | ([0-9a-FA-F] {1,4}:) {1,7}: | ([0-9a-FA-F] {1, 4}:) {1,6}: [0-9a-FA-F] {1,4} | ([0-9a-FA-F] {1,4}:) {1,5} (:[0-9a-FA-F] {1,4}) {1,2} | ([0-9a-FA-F] {1,4}:) {1,4} (: [0-9a-FA-F] {1,4}) {1,3} | ([0-9a-FA-F] {1,4}:) {1,3} (: [0-9a-FA-F] {1,4}) {1,4} | ([0-9a-FA-F] {1,4}:) {1,2} (: [0-9a-FA-F] {1,4}){1,5} | [0-9a-FA-F] {1,4}: ((: [0-9a-FA-F] {1,4}) {1,6}) |: ((:[0-9a-FA-F] {1,4}) {1,7} |:) | fe80: (: [0-9a-FA-F] {0,4}) {0,4}% [0-9a-Za-Z] {1} |: :( FFFF (: 0 {1,4}) {0,1}:) {0,1} ((25 [0-5] | (2 [0-4] | 1 {0,1} [0-9]) {0,1} [0-9])) {3,3} (25 [0-5] |. (2 [0-4]| 1 {0,1} [0-9]) {0,1} [0-9]) | ([0-9a-FA-F] {1,4}:) {1,4}: ((25 [0-5] | (2 [0-4] | 1 {0,1} [0-9]) {0,1} [0-9])) {3,3} (25 [0-.5] | (2 [0-4] | 1 {0,1} [0-9]) {0,1} [0-9])) 'file