grep -oP '.{0,20}deviceName.{0,20}' data.log grep -oE '.{0,20}deviceName.{0,20}' data.log (在 macos下,不认识 -P 参数)
more data.log | cut -c 1-20