[{"data":1,"prerenderedAt":146},["ShallowReactive",2],{"blog-post-ripgrep-limit-output":3,"recent-posts":82},{"id":4,"uid":5,"url":6,"type":7,"href":8,"tags":9,"first_publication_date":10,"last_publication_date":10,"slugs":11,"linked_documents":13,"lang":14,"alternate_languages":15,"data":16},"awbJexIAACoAJT6t","ripgrep-limit-output",null,"blog_posts","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=axNCmBMAACwA2vJJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awbJexIAACoAJT6t%22%29+%5D%5D",[],"2026-12-03T22:46:13+0000",[12],"ripgrep-how-to-limit-output",[],"en-us",[],{"title":17,"date":23,"description":24,"image":29,"content":39},[18],{"type":19,"text":20,"spans":21,"direction":22},"heading1","Ripgrep: How to Limit Output",[],"ltr","2026-12-03",[25],{"type":26,"text":27,"spans":28,"direction":22},"heading2","Learn how to limit and shorten the output of ripgrep (rg)",[],{"dimensions":30,"alt":20,"copyright":6,"url":33,"id":34,"edit":35},{"width":31,"height":32},1280,720,"https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002Fj4Wnb8WpcNFvu99I_ripgrep-limit-output.png?auto=format,compress","j4Wnb8WpcNFvu99I",{"x":36,"y":36,"zoom":37,"background":38},0,1,"transparent",[40,44,48,51,54,57,60,63,66,69,72,75,79],{"type":41,"text":42,"spans":43,"direction":22},"paragraph","Before we start, make sure you have ripgrep installed on your computer. On a Mac, you can install it with Homebrew:",[],{"type":45,"text":46,"spans":47,"direction":22},"preformatted","brew install ripgrep",[],{"type":41,"text":49,"spans":50,"direction":22},"First, open your terminal and navigate to your project folder. If a minified file floods your screen with one giant line, hide long lines with \u003Ccode>-M\u003C\u002Fcode>:",[],{"type":45,"text":52,"spans":53,"direction":22},"rg -M 100 \"pattern\"",[],{"type":41,"text":55,"spans":56,"direction":22},"Any line longer than \u003Ccode>100\u003C\u002Fcode> characters is replaced with a short note, like \u003Ccode>[Omitted long line with 25 matches]\u003C\u002Fcode>. Add \u003Ccode>--max-columns-preview\u003C\u002Fcode> if you'd rather see the start of it.",[],{"type":41,"text":58,"spans":59,"direction":22},"To stop after a set number of matches in each file, use a lowercase \u003Ccode>-m\u003C\u002Fcode>:",[],{"type":45,"text":61,"spans":62,"direction":22},"rg -m 1 \"pattern\"",[],{"type":41,"text":64,"spans":65,"direction":22},"Just remember that \u003Ccode>-m\u003C\u002Fcode> works per file, so five matching files still give you five results. If you only want the names of the matching files, use \u003Ccode>-l\u003C\u002Fcode>:",[],{"type":45,"text":67,"spans":68,"direction":22},"rg -l \"pattern\"",[],{"type":41,"text":70,"spans":71,"direction":22},"To cap the total number of lines across everything, pipe the results into \u003Ccode>head\u003C\u002Fcode>:",[],{"type":45,"text":73,"spans":74,"direction":22},"rg \"pattern\" | head -n 5",[],{"type":76,"oembed":77},"embed",{"embed_url":78,"type":76},"",{"type":41,"text":80,"spans":81,"direction":22},"If you only care whether something matches at all, for example in a script, use \u003Ccode>-q\u003C\u002Fcode>. It prints nothing and just sets the exit code.",[],{"results":83,"page":37,"results_per_page":144,"results_size":144,"total_results_size":145,"total_pages":37},[84,105,124],{"id":85,"uid":86,"url":6,"type":7,"href":87,"tags":88,"first_publication_date":89,"last_publication_date":89,"slugs":90,"linked_documents":92,"lang":14,"alternate_languages":93,"data":94},"awgi0RIAACYAhiZv","ripgrep-replace-text-in-files","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=axNCmBMAACwA2vJJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awgi0RIAACYAhiZv%22%29+%5D%5D",[],"2026-12-04T22:45:44+0000",[91],"how-to-replace-text-in-files-with-ripgrep-and-sed",[],[],{"image":95,"title":101},{"dimensions":96,"alt":97,"copyright":6,"url":98,"id":99,"edit":100},{"width":31,"height":32},"Ripgrep: How to Replace Text in Files with Ripgrep and Sed","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002FOlJ7le5oNEXxcE_I_ripgrep-replace-text-in-files.png?auto=format,compress","OlJ7le5oNEXxcE_I",{"x":36,"y":36,"zoom":37,"background":38},[102],{"type":19,"text":103,"spans":104,"direction":22},"How to Replace Text in Files with Ripgrep and Sed",[],{"id":106,"uid":107,"url":6,"type":7,"href":108,"tags":109,"first_publication_date":89,"last_publication_date":89,"slugs":110,"linked_documents":112,"lang":14,"alternate_languages":113,"data":114},"awgi2hIAACoAhiaF","ripgrep-case-insensitive-search","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=axNCmBMAACwA2vJJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awgi2hIAACoAhiaF%22%29+%5D%5D",[],[111],"ripgrep-how-to-search-case-insensitive",[],[],{"image":115,"title":121},{"dimensions":116,"alt":117,"copyright":6,"url":118,"id":119,"edit":120},{"width":31,"height":32},"Ripgrep: How to Search Case Insensitive","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F6H2DfjROfkSO4wel_ripgrep-case-insensitive-search.png?auto=format,compress","6H2DfjROfkSO4wel",{"x":36,"y":36,"zoom":37,"background":38},[122],{"type":19,"text":117,"spans":123,"direction":22},[],{"id":125,"uid":126,"url":6,"type":7,"href":127,"tags":128,"first_publication_date":89,"last_publication_date":89,"slugs":129,"linked_documents":131,"lang":14,"alternate_languages":132,"data":133},"awgi_hIAACoAhibc","jq-use-with-curl","https:\u002F\u002Fmarks-personal-website.cdn.prismic.io\u002Fapi\u002Fv2\u002Fdocuments\u002Fsearch?ref=axNCmBMAACwA2vJJ&q=%5B%5B%3Ad+%3D+at%28document.id%2C+%22awgi_hIAACoAhibc%22%29+%5D%5D",[],[130],"how-to-use-jq-with-curl",[],[],{"image":134,"title":140},{"dimensions":135,"alt":136,"copyright":6,"url":137,"id":138,"edit":139},{"width":31,"height":32},"jq: How to Use jq with curl","https:\u002F\u002Fimages.prismic.io\u002Fmarks-personal-website\u002F3JyqU0cTsv3S-6D0_jq-use-with-curl.png?auto=format,compress","3JyqU0cTsv3S-6D0",{"x":36,"y":36,"zoom":37,"background":38},[141],{"type":19,"text":142,"spans":143,"direction":22},"How to Use 'jq' with 'curl'",[],3,137,1796424369603]