{"id":42630,"date":"2019-05-19T12:32:52","date_gmt":"2019-05-19T10:32:52","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=42630"},"modified":"2019-05-19T12:33:05","modified_gmt":"2019-05-19T10:33:05","slug":"40x-speed-up-of-ls-on-large-dirs","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2019\/05\/19\/40x-speed-up-of-ls-on-large-dirs\/","title":{"rendered":"40x speed up of ls on large dirs"},"content":{"rendered":"<!-- google_ad_section_start -->\n\n<p class=\"wp-block-paragraph\">If you ever tried listing a directory with a lot (10,000+) of files in it, I&#8217;m sure you know how annoyingly slow &#8216;ls&#8217; can be.  Turns out there is a simple way to make it better.  Have a look at the &#8220;<a href=\"https:\/\/news.sherlock.stanford.edu\/posts\/when-setting-an-environment-variable-gives-you-a-40-x-speedup\">When setting an environment variable gives you a 40x speedup<\/a>&#8221; blog post.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or just do the following:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; gutter: false; title: ; notranslate\" title=\"\">\nexport LS_COLORS=&#039;ex=00:su=00:sg=00:ca=00:&#039;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">This will disable colors on the executable files, setuid\/setgid bits, and capabilities.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>If you ever tried listing a directory with a lot (10,000+) of files in it, I&#8217;m sure you know how annoyingly slow &#8216;ls&#8217; can be. Turns out there is a simple way to make it better. Have a look at the &#8220;When setting an environment variable gives you a 40x speedup&#8221; blog post. Or just &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2019\/05\/19\/40x-speed-up-of-ls-on-large-dirs\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">40x speed up of ls on large dirs<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"40x speed up of ls on large dirs #hosting #linux #unix #CLI #bash #performance","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,6,133,62],"tags":[3098,1960,616,1057,2289],"keyring_services":[],"class_list":["post-42630","post","type-post","status-publish","format-standard","hentry","category-general","category-linux","category-sysadmin","category-technology","tag-bash","tag-command-line","tag-filesystem","tag-performance","tag-web-hosting"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":9488,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/09\/23\/finding-files-in-linux\/","url_meta":{"origin":42630,"position":0},"title":"Finding files in Linux","author":"Leonid Mamchenkov","date":"September 23, 2005","format":false,"excerpt":"Many beginning Linux users experience difficulties getting used to the filesystem structure. Indeed, there are many files and directories, the structure of which are not as obvious as it could be. Choosing an appropriate location for a new file or directory is difficult and many choose to follow their own\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":31955,"url":"https:\/\/mamchenkov.net\/wordpress\/2019\/02\/05\/dotfile-madness\/","url_meta":{"origin":42630,"position":1},"title":"Dotfile madness","author":"Leonid Mamchenkov","date":"February 5, 2019","format":false,"excerpt":"\"Dotfile madness\" is an excellent look at the problem of hidden data and configuration files that seem to be multiplying lately in the users' home directories: We are no longer in control of our home directories.My own home directory contains 25 ordinary files and 144 hidden files. The dotfiles contain\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7368,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/03\/23\/fix-rpm-process-hanging-on-a-red-hat-linux-installation\/","url_meta":{"origin":42630,"position":2},"title":"Fix RPM process hanging on a Red Hat Linux installation","author":"Leonid Mamchenkov","date":"March 23, 2004","format":false,"excerpt":"Unfortunately, it happens rather often recently that Red Hat Package Manager (rpm) just hangs during some operation. After it does so, rpm stops working completely and even reboot (hehe) doesn't help. Well, the problem is well known and is in Red Hat's bugzilla. For now, here is a quick fix\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11193,"url":"https:\/\/mamchenkov.net\/wordpress\/2008\/05\/06\/ubuntu-fedora-release-party\/","url_meta":{"origin":42630,"position":3},"title":"Ubuntu \/ Fedora release party","author":"Leonid Mamchenkov","date":"May 6, 2008","format":false,"excerpt":"Theodotos sent me a message, letting me know of the upcoming Ubuntu \/ Fedora release party that will take place in Frederick University on May 17, 2008. Here is a quote from the announcement: office furniture in Bulgaria Taking the opportunity of the new releases of Ubuntu 8.04 Hardy Heron\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7175,"url":"https:\/\/mamchenkov.net\/wordpress\/2003\/07\/06\/hardware-rearrangements\/","url_meta":{"origin":42630,"position":4},"title":"Hardware rearrangements","author":"Leonid Mamchenkov","date":"July 6, 2003","format":false,"excerpt":"Real fun day! :) After I woke up, I've continued with assembling of the new PC. When I was almost done, Olga came in and suggested that my home network planning and planning of hosts locations was totally wrong. After a bit of thinking I was convinced and started to\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16266,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/05\/02\/fedora-18-spherical-cow\/","url_meta":{"origin":42630,"position":5},"title":"Fedora 18 : Spherical Cow","author":"Leonid Mamchenkov","date":"May 2, 2012","format":false,"excerpt":"First, the source: Thank you to everyone who participated in voting for the Fedora 18 release name. The name for Fedora 18, the follow-up to Beefy Miracle, is: Spherical Cow Voting period: Friday 2012-04-20 00:00:00 to Friday 2012-04-27 00:00:00 Number of valid ballots cast: 429 That offset a lot of\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/42630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=42630"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/42630\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=42630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=42630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=42630"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=42630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}