{"id":3178,"date":"2010-04-09T08:26:10","date_gmt":"2010-04-09T08:26:10","guid":{"rendered":""},"modified":"2026-04-18T22:54:25","modified_gmt":"2026-04-18T22:54:25","slug":"how-to-exclude-files-when-using-ls","status":"publish","type":"post","link":"https:\/\/hellem.org\/wblog\/?p=3178","title":{"rendered":"How to exclude files when using ls"},"content":{"rendered":"<p>Had a directory with > 150 *.properties-files and needed to check if there where any files not ending with .properties. <a href=\"http:\/\/en.wikipedia.org\/wiki\/Ls\">ls<\/a> lists all the files, combine it with <a href=\"http:\/\/en.wikipedia.org\/wiki\/Grep\">grep <\/a> and you are saved.<\/p>\n<blockquote><p>\n# See all files ending in .html<br \/>\nls | grep &#8220;\\.html$&#8221;<br \/>\n# see all files not ending in .html<br \/>\nls | grep -v &#8220;\\.html$&#8221;\n<\/p><\/blockquote>\n<p>Solution found at <a href=\"http:\/\/www.unix.com\/shell-programming-scripting\/100038-ls-exclude-pattern.html\">unix.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Had a directory with > 150 *.properties-files and needed to check if there where any files not ending with .properties. ls lists all the files, combine it with grep and you are saved. # See all files ending in .html ls | grep &#8220;\\.html$&#8221; # see all files not ending in .html ls | grep [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-3178","post","type-post","status-publish","format-standard","hentry","category-work-geek"],"_links":{"self":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/3178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3178"}],"version-history":[{"count":1,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/3178\/revisions"}],"predecessor-version":[{"id":14426,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=\/wp\/v2\/posts\/3178\/revisions\/14426"}],"wp:attachment":[{"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hellem.org\/wblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}