[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573639-105":53,"doc-detail-573639-en":125},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":118,"head_meta":120,"extra_data":122,"updated_unix":124},105,"en","log-parsing-cheat-sheet-commands-and-options-guide","Log Parsing Cheat Sheet - Commands and Options Guide","","Log Parsing Cheat Sheet整理了多种用于日志分析与文本处理的常用命令及其参数用法，涵盖GREP/NGREP/CUT/SED/SORT/UNIQ/DIFF/AWK等离散处理工具，以及HEAD/TAIL/LESS/COMM/CSVCUT/JQ/TR/CCZE等查看、筛选与格式化场景。内容以示例命令展示常见选项，如正则匹配、大小写无关、行数与计数、反向匹配、输出文件、分隔符字段提取、JSON/CSV解析、流式查看与颜色化显示，便于快速构建日志检索与差异对比流程。",{"@graph":63,"@context":117},[64,80,100],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/log-parsing-cheat-sheet-commands-and-options-guide/573639/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":94,"encodingFormat":93,"isAccessibleForFree":95,"interactionStatistic":96},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/log-parsing-cheat-sheet-commands-and-options-guide/573639.png","ImageObject",442,249,{"name":88,"@type":89},"LangkahRina","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-14",true,{"@type":97,"interactionType":98,"userInteractionCount":9},"InteractionCounter",{"@type":99},"ViewAction",{"@type":101,"mainEntity":102},"FAQPage",[103,109,113],{"name":104,"@type":105,"acceptedAnswer":106},"GREP常用选项有哪些，用于日志模式搜索？","Question",{"text":107,"@type":108},"常用选项包括-n显示匹配行号、-i忽略大小写、-v反向匹配、-E使用扩展正则、-c统计匹配次数、-l输出匹配的文件名。","Answer",{"name":110,"@type":105,"acceptedAnswer":111},"CUT如何从分隔日志中提取指定字段？",{"text":112,"@type":108},"使用cut通过-d指定字段分隔符（示例为“:”）并用-f选择字段序号；相关参数还包括-c用于字符位置指定以及-c/ -f的组合用法。",{"name":114,"@type":105,"acceptedAnswer":115},"JQ和CSVCUT分别用于解析哪类数据？",{"text":116,"@type":108},"JQ用于解析JSON文件，可进行pretty print与数组元素提取（如输出特定keyname）。CSVCUT用于处理CSV文件，可通过-c/ -C选择指定列或排除列，并可用-x删除空行。","https://schema.org",{"og:url":78,"og:type":119,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":121,"canonical":78},"index,follow",{"doc_id":123,"site_id":56},573639,1792014109,{"code":4,"msg":5,"data":126},{"doc_id":123,"user_id":127,"nickname":88,"user_avatar":128,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":129,"file_id":130,"file_url":131,"file_type":132,"file_size":133,"view_count":9,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":134,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":135,"faqs":136,"seo_title":137,"seo_description":61,"update_tm":138,"read_time":9},962090893776,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","Log Parsing Cheat Sheet  \n|  GREP | GREP allows you to search patterns in files. ZGREP for GZIP files.\u003Cbr>$grep \u003Cpattern> file.log | -n: Number of lines that matches\u003Cbr>-i: Case insensitive\u003Cbr>-v: Invert matches\u003Cbr>-E: Extended regex\u003Cbr>-c: Count number of matches\u003Cbr>-l: Find filenames that matches the pattern |\n| --- | --- | --- |\n|  NGREP | NGREP is used for analyzing network packets.\u003Cbr>$ ngrep-I file.pcap | -d: Specify network interface\u003Cbr>-i: Case insensitive.\u003Cbr>-x: Print in alternate hexdump\u003Cbr>-t: Print timestamp\u003Cbr>-I: Read pcap file |\n|  CUT | The CUT command is used to parse fields from delimited logs.\u003Cbr>$cut-d “:” -f 2 file.log | -d: Use the field delimiter\u003Cbr>-f: The field numbers\u003Cbr>-c: Specifies characters position |\n|  SED | SED (Stream Editor) is used to replace strings in a file.\u003Cbr>$sed s/regex/replace/g | s: Search -e: Execute command g: Replace -n: Suppress output dw:: DAeppleetend to file |\n|  SORT | SORT is used to sort a file.\u003Cbr>$sort foo.txt | -o: Output to file -c: Check if ordered\u003Cbr>-r: Reverse order -u: Sort and remove.\u003Cbr>-n: Numerical sort -f: Ignore case\u003Cbr>-k: Sort by column. -h: Human sort |\n| 1 UNIQ\u003Cbr>| UNIQ is used to extract uniq occurrences.\u003Cbr>$uniq foo.txt | -c: Count the number of duplicates\u003Cbr>-d: Print duplicates\u003Cbr>-i: Case insensitive |\n|  DIFF | DIFF is used to display differences in files by comparing line by line.\u003Cbr>$diff foo.log bar. log | How to read output? ac: AddChange : : LFnlee 1 numbers d: Delete >: File 2 |\n|  AWK | AWK is a programming language use to manipulate data.\u003Cbr>$awk {print $2} foo.log | Print first column with separator “:”\u003Cbr>$awk-F: '{print $ 1}' /etc/passwd\u003Cbr>Extract uniq value from two files:\u003Cbr>awk 'FNR==NR {a[$0]++; next} !($0 in a)' f1.txt f2.txt |\n\n@FrØgger_Thomas Roccia  \nLog Parsing Cheat Sheet 2  \n| HEAD | HEAD is used to display the first 10 lines of a file by default.\u003Cbr>$ head file.log | -n: Number of lines to display\u003Cbr>-c: Number of bytes to display |\n| --- | --- | --- |\n|  TAIL | TAIL is used to display the last 10 lines of a file by default.\u003Cbr>$tail file.log | -n: Number of lines to display\u003Cbr>-f: Wait for additional data\u003Cbr>-F: Same as-f even if file is rotated |\n| LESS | LESS is used to visualize the content of a file, faster than MORE. ZLESS for compressed files.\u003Cbr>$ less file.log | space: Display next page /n: : SearNextch\u003Cbr>g: Beginning of the file\u003Cbr>G: End of the file +F: Like tail -f |\n| COMM | COMM is used to select or reject lines common to two files.\u003Cbr>$comm foo.log bar.log | Three columns as output: Column 1: lines only in file 1\u003Cbr>Column 2: lines only in file 2\u003Cbr>Column 3: lines in both files\u003Cbr>-1, -2, -3: Suppress columns output |\n| CSVCUT\u003Cbr>| CSVCUT is used toparse CSV files.\u003Cbr>$ csvcut-c 3 data. csv | -n: Print columns name\u003Cbr>-c: Extract the specified column\u003Cbr>-C: Extract all columns except specified one\u003Cbr>-x: Delete empty rows |\n| JQ | JQ is used to parse JSON files.\u003Cbr>$jq . fooj. son | [jq . fj. son:](jq . fj. son:) Pretty print\u003Cbr>jq '.[]' fj. son: Output elements from arrays jq '.[0].\u003Ckeyname>' fj. son |\n| TR | TR is used to replace a character in a file.\u003Cbr>$ tr \";\" \",\" \u003C foo.txt | -d: Delete character\u003Cbr>-s: Compress characters to a single one\u003Cbr>Lower to upper every character:\u003Cbr>tr \"[:lower:]\" \"[:upper:]\" \u003C foo.txt |\n| CCZE | CCZE is used to color logs.\u003Cbr>$ccze \u003C foo.log | -h: Output in html\u003Cbr>-C: Convert Unix timestamp\u003Cbr>-l: List available plugins\u003Cbr>-p: Load specified plugin |\n\n@FrØgger_Thomas Roccia","cbCairvus3GswVGN","https://ap.wps.com/l/cbCairvus3GswVGN","pdf",408531,"English","# GREP\n## NGREP\n# CUT\n## SED\n# SORT\n## UNIQ\n# DIFF\n## AWK\n# HEAD\n## TAIL\n# LESS\n## COMM\n# CSVCUT\n## JQ\n# TR\n## CCZE","[{\"question\":\"GREP常用选项有哪些，用于日志模式搜索？\",\"answer\":\"常用选项包括-n显示匹配行号、-i忽略大小写、-v反向匹配、-E使用扩展正则、-c统计匹配次数、-l输出匹配的文件名。\"},{\"question\":\"CUT如何从分隔日志中提取指定字段？\",\"answer\":\"使用cut通过-d指定字段分隔符（示例为“:”）并用-f选择字段序号；相关参数还包括-c用于字符位置指定以及-c/ -f的组合用法。\"},{\"question\":\"JQ和CSVCUT分别用于解析哪类数据？\",\"answer\":\"JQ用于解析JSON文件，可进行pretty print与数组元素提取（如输出特定keyname）。CSVCUT用于处理CSV文件，可通过-c/ -C选择指定列或排除列，并可用-x删除空行。\"}]","Log Parsing Cheat Sheet - Commands and Options Guide | PDF",1791943685]