查看关键字前后20个字符
grep -oP '.{0,20}deviceName.{0,20}' data.log
grep -oE '.{0,20}deviceName.{0,20}' data.log (在 macos下,不认识 -P 参数)
只显示一行日志的第 1 ~ 20 个字符
标签:deviceName,20,log,linux,grep,日志,data From: https://www.cnblogs.com/aaacarrot/p/17836947.htmlmore data.log | cut -c 1-20