{"id":2817,"date":"2013-08-23T07:27:05","date_gmt":"2013-08-23T11:27:05","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/08\/23\/speed-up-grep-searches-with-lc-all\/"},"modified":"2025-03-15T22:15:04","modified_gmt":"2025-03-16T02:15:04","slug":"speed-up-grep-searches-with-lc-all","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/","title":{"rendered":"Speed Up grep Searches with LC_ALL=C"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches-1024x538.png\" alt=\"Speed Up grep Searches with LC_ALL=C\" class=\"wp-image-129686\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches-1024x538.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches-300x158.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches-768x403.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png 1200w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/figure>\n\n\n\n<p>When searching through large files or directories using <code>grep<\/code>, performance can sometimes be slow. One way to speed up <code>grep<\/code> searches is by setting the <code>LC_ALL<\/code> environment variable. This article explains how <code>LC_ALL<\/code> affects <code>grep<\/code> performance and how you can use it to optimize search speed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding Locale and Internationalization Variables<\/h2>\n\n\n\n<p>In a shell execution environment, system behavior is influenced by environment variables. A special subset of these variables, known as internationalization variables, determines how support for internationalized applications operates. Since <code>grep<\/code> is an internationalized application, its performance is affected by these settings.<\/p>\n\n\n\n<p>You can check your server\u2019s current locale settings by running:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"locale\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">locale<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Example output:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"LANG=en_US.UTF-8\nLC_CTYPE=&quot;en_US.UTF-8&quot;\nLC_NUMERIC=&quot;en_US.UTF-8&quot;\nLC_TIME=&quot;en_US.UTF-8&quot;\nLC_COLLATE=&quot;en_US.UTF-8&quot;\nLC_MONETARY=&quot;en_US.UTF-8&quot;\nLC_MESSAGES=&quot;en_US.UTF-8&quot;\nLC_PAPER=&quot;en_US.UTF-8&quot;\nLC_NAME=&quot;en_US.UTF-8&quot;\nLC_ADDRESS=&quot;en_US.UTF-8&quot;\nLC_TELEPHONE=&quot;en_US.UTF-8&quot;\nLC_MEASUREMENT=&quot;en_US.UTF-8&quot;\nLC_IDENTIFICATION=&quot;en_US.UTF-8&quot;\nLC_ALL=\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E1E4E8\">LANG<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">en_US.UTF-8<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_CTYPE<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_NUMERIC<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_TIME<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_COLLATE<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_MONETARY<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_MESSAGES<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_PAPER<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_NAME<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_ADDRESS<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_TELEPHONE<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_MEASUREMENT<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_IDENTIFICATION<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">\"en_US.UTF-8\"<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">LC_ALL<\/span><span style=\"color: #F97583\">=<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Why Does LC_ALL Affect grep Speed?<\/h2>\n\n\n\n<p>The <code>LC_ALL<\/code> variable controls locale settings, including character encoding and collation order. By default, <code>grep<\/code> processes text based on locale-specific rules, which can slow down searches. Setting <code>LC_ALL=C<\/code> forces <code>grep<\/code> to use a more straightforward, faster byte-based comparison instead of complex locale-aware processing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">LC_ALL Variable Explained<\/h3>\n\n\n\n<p>The <code>LC_ALL<\/code> variable overrides all other <code>LC_*<\/code> settings, allowing you to set the locale globally for a command or session. For instance, appending <code>LC_ALL=C<\/code> before a command changes its locale setting to the <code>C<\/code> locale, which is the default Unix\/Linux ASCII environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use LC_ALL to Speed Up grep<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Temporary Use in a Single Command<\/h3>\n\n\n\n<p>If you want to apply <code>LC_ALL=C<\/code> for single <code>grep<\/code> command, prefix the command as follows:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"LC_ALL=C grep &quot;search_term&quot; file.txt\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E1E4E8\">LC_ALL<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">C<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #B392F0\">grep<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">\"search_term\"<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">file.txt<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>This tells <code>grep<\/code> to use the <code>C<\/code> locale for that specific command, improving performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Setting LC_ALL Permanently<\/h3>\n\n\n\n<p>To make this optimization permanent, you can export <code>LC_ALL<\/code> in your shell profile file.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">For Bash Users:<\/h4>\n\n\n\n<p>Add the following line to your <code>~\/.bashrc<\/code> or <code>~\/.bash_profile<\/code> file:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"export LC_ALL=C\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">export<\/span><span style=\"color: #E1E4E8\"> LC_ALL<\/span><span style=\"color: #F97583\">=<\/span><span style=\"color: #9ECBFF\">C<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Then, apply the changes by running:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"source ~\/.bashrc\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #79B8FF\">source<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">~\/.bashrc<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">For Zsh Users:<\/h4>\n\n\n\n<p>If you use Zsh, add the same line to <code>\/.zshrc<\/code> and apply the changes:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"source ~\/.zshrc\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #79B8FF\">source<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">~\/.zshrc<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">UTF-8 vs ASCII: Why Does it Matter?<\/h2>\n\n\n\n<p>By default, most modern systems use UTF-8 encoding. UTF-8 can represent over 110,000 unique characters, supporting multiple writing systems worldwide. However, <code>grep<\/code> is often used to search through files encoded in ASCII, which consists of only 128 unique characters.<\/p>\n\n\n\n<p>Because UTF-8 requires more complex processing, searches using the default locale settings may be slower. By switching to the <code>C<\/code> locale (which defaults to ASCII), <code>grep<\/code> can operate more efficiently, reducing processing overhead and improving performance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Performance Comparison<\/h2>\n\n\n\n<p>To compare performance with and without <code>LC_ALL=C<\/code>, use the <code>time<\/code> command:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"time grep &quot;search_term&quot; large_file.txt\ntime LC_ALL=C grep &quot;search_term&quot; large_file.txt\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">time<\/span><span style=\"color: #E1E4E8\"> grep <\/span><span style=\"color: #9ECBFF\">\"search_term\"<\/span><span style=\"color: #E1E4E8\"> large_file.txt<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">time<\/span><span style=\"color: #E1E4E8\"> LC_ALL=C grep <\/span><span style=\"color: #9ECBFF\">\"search_term\"<\/span><span style=\"color: #E1E4E8\"> large_file.txt<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>You should notice a significant decrease in execution time when using <code>LC_ALL=C<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Test Results<\/h2>\n\n\n\n<p>Several tests were conducted using different file sizes to measure the impact of <code>LC_ALL=C<\/code>:<\/p>\n\n\n\n<p><strong>Test 1: Small File (~10MB)<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"time grep &quot;search_term&quot; large_file.txt\ntime LC_ALL=C grep &quot;search_term&quot; large_file.txt\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">time<\/span><span style=\"color: #E1E4E8\"> grep <\/span><span style=\"color: #9ECBFF\">\"search_term\"<\/span><span style=\"color: #E1E4E8\"> large_file.txt<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">time<\/span><span style=\"color: #E1E4E8\"> LC_ALL=C grep <\/span><span style=\"color: #9ECBFF\">\"search_term\"<\/span><span style=\"color: #E1E4E8\"> large_file.txt<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>Results:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Standard <code>grep<\/code>: ~0.3s<\/li>\n\n\n\n<li><code>LC_ALL=C grep<\/code>: ~0.2s<\/li>\n<\/ul>\n\n\n\n<p><strong>Test 2: Medium File (~500MB)<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"time grep &quot;example&quot; medium_file.txt\ntime LC_ALL=C grep &quot;example&quot; medium_file.txt\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">time<\/span><span style=\"color: #E1E4E8\"> grep <\/span><span style=\"color: #9ECBFF\">\"example\"<\/span><span style=\"color: #E1E4E8\"> medium_file.txt<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">time<\/span><span style=\"color: #E1E4E8\"> LC_ALL=C grep <\/span><span style=\"color: #9ECBFF\">\"example\"<\/span><span style=\"color: #E1E4E8\"> medium_file.txt<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>Results: <\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Standard <code>grep<\/code>: ~5.2s<\/li>\n\n\n\n<li><code>LC_ALL=C grep<\/code>: ~3.1s<\/li>\n<\/ul>\n\n\n\n<p><strong>Test 3: Large File (~5GB)<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono-NL.ttf\" style=\"font-size:clamp(16px, 1rem, 24px);font-family:Code-Pro-JetBrains-Mono-NL,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:clamp(26px, 1.625rem, 39px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"time grep &quot;example&quot; large_file.txt\ntime LC_ALL=C grep &quot;example&quot; large_file.txt\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewbox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">time<\/span><span style=\"color: #E1E4E8\"> grep <\/span><span style=\"color: #9ECBFF\">\"example\"<\/span><span style=\"color: #E1E4E8\"> large_file.txt<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">time<\/span><span style=\"color: #E1E4E8\"> LC_ALL=C grep <\/span><span style=\"color: #9ECBFF\">\"example\"<\/span><span style=\"color: #E1E4E8\"> large_file.txt<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>Results:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Standard <code>grep<\/code>: ~50.4s<\/li>\n\n\n\n<li><code>LC_ALL=C grep<\/code>: ~28.7s<\/li>\n<\/ul>\n\n\n\n<p>The tests confirmed that using <code>LC_ALL=C<\/code> provides a noticeable performance improvement, especially for large files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>By setting <code>LC_ALL=C<\/code>, you can enhance <code>grep<\/code> search performance, especially when dealing with large files. This simple optimization reduces processing overhead and speeds up search operations, making it an effective tweak for power users and system administrators.<\/p>\n\n\n\n<p>For more Linux tips, check out our <a href=\"https:\/\/www.inmotionhosting.com\/support\/\">Linux tutorials<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When searching through large files or directories using grep, performance can sometimes be slow. One way to speed up grep searches is by setting the LC_ALL environment variable. This article explains how LC_ALL affects grep performance and how you can use it to optimize search speed. Understanding Locale and Internationalization Variables In a shell execution<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57014,"featured_media":129686,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4308],"tags":[],"class_list":["post-2817","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Speed Up grep Searches with LC_ALL=C | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"Boost grep search speed by using LC_ALL=C. Learn how locale settings impact performance and see test results showing significant improvements\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Speed Up grep Searches with LC_ALL=C | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"Boost grep search speed by using LC_ALL=C. Learn how locale settings impact performance and see test results showing significant improvements\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-08-23T11:27:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-16T02:15:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\"},\"headline\":\"Speed Up grep Searches with LC_ALL=C\",\"datePublished\":\"2013-08-23T11:27:05+00:00\",\"dateModified\":\"2025-03-16T02:15:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/\"},\"wordCount\":484,\"commentCount\":10,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png\",\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/\",\"name\":\"Speed Up grep Searches with LC_ALL=C | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png\",\"datePublished\":\"2013-08-23T11:27:05+00:00\",\"dateModified\":\"2025-03-16T02:15:04+00:00\",\"description\":\"Boost grep search speed by using LC_ALL=C. Learn how locale settings impact performance and see test results showing significant improvements\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#primaryimage\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png\",\"width\":1200,\"height\":630,\"caption\":\"Speed Up grep Searches with LC_ALL=C\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Speed Up grep Searches with LC_ALL=C\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644\",\"name\":\"InMotion Hosting Contributor\",\"description\":\"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/inmotion-hosting\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Speed Up grep Searches with LC_ALL=C | InMotion Hosting","description":"Boost grep search speed by using LC_ALL=C. Learn how locale settings impact performance and see test results showing significant improvements","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/","og_locale":"en_US","og_type":"article","og_title":"Speed Up grep Searches with LC_ALL=C | InMotion Hosting","og_description":"Boost grep search speed by using LC_ALL=C. Learn how locale settings impact performance and see test results showing significant improvements","og_url":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-08-23T11:27:05+00:00","article_modified_time":"2025-03-16T02:15:04+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png","type":"image\/png"}],"author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644"},"headline":"Speed Up grep Searches with LC_ALL=C","datePublished":"2013-08-23T11:27:05+00:00","dateModified":"2025-03-16T02:15:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/"},"wordCount":484,"commentCount":10,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png","articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/","url":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/","name":"Speed Up grep Searches with LC_ALL=C | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png","datePublished":"2013-08-23T11:27:05+00:00","dateModified":"2025-03-16T02:15:04+00:00","description":"Boost grep search speed by using LC_ALL=C. Learn how locale settings impact performance and see test results showing significant improvements","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png","width":1200,"height":630,"caption":"Speed Up grep Searches with LC_ALL=C"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/speed-up-grep-searches-with-lc-all\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Speed Up grep Searches with LC_ALL=C"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/f9a4fc454cd1df128ee8e898d30d4644","name":"InMotion Hosting Contributor","description":"InMotion Hosting contributors are highly knowledgeable individuals who create relevant content on new trends and troubleshooting techniques to help you achieve your online goals!","sameAs":["https:\/\/www.linkedin.com\/company\/inmotion-hosting\/","https:\/\/x.com\/https:\/\/twitter.com\/InMotionHosting"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/inmotion-hosting-contributor\/"}]}},"jetpack_featured_media_url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/08\/speed-up-greo-searches.png","jetpack_sharing_enabled":true,"primary_category":{"id":4308,"name":"Linux","slug":"linux","link":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57014"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=2817"}],"version-history":[{"count":5,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2817\/revisions"}],"predecessor-version":[{"id":129689,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/2817\/revisions\/129689"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media\/129686"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=2817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=2817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=2817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}