

{"id":288,"date":"2026-06-16T18:25:22","date_gmt":"2026-06-16T18:25:22","guid":{"rendered":"https:\/\/apropostechsolutionscorp.ca\/blog\/?p=288"},"modified":"2026-06-16T18:25:22","modified_gmt":"2026-06-16T18:25:22","slug":"linux-terminal-commands-showing-non-match","status":"publish","type":"post","link":"https:\/\/apropostechsolutionscorp.ca\/blog\/2026\/06\/16\/linux-terminal-commands-showing-non-match\/","title":{"rendered":"Linux terminal commands: showing non-match"},"content":{"rendered":"\n<h3>Sometimes you want to weed out the &#8220;cannots.&#8221;<\/h3>\n<p>\nThe following is as I recall it.<\/p>\n<p>\nYesterday I was in a server file system using the Linux terminal. I wanted to know about the folders the terminal could access, not the ones it couldn&#8217;t. Yet, there were more it couldn&#8217;t.<\/p>\n<p>\nI pipelined the command into grep:<\/p>\n<p><em>command<\/em> | grep -v &#8220;cannot&#8221;<\/p>\n<p>\nbut it was still showing the &#8220;cannot&#8221; lines.<\/p>\n<p>\nI learned from another source that the reason is grep only works on standard output, file handle 1 in the terminal, whereas &#8220;cannot&#8221; typically will come from standard error, file handle 2.<\/p>\n<p>\nWhen I tried<\/p>\n<p>\n<em>command<\/em> 2&gt;&amp;1 | grep -v cannot<\/p>\n<p>\nI got what I was hoping for. Apparently 2&gt;&amp;1 feeds standard error into standard output, so grep can work on it.<\/p>\n<p>\nInteresting, eh?<\/p>\n<p>\nSource:<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/44205240\/grep-command-invert-option-not-working\">stackoverflow.com<\/a><\/p>\n<p><a href=\"https:\/\/man7.org\/linux\/man-pages\/man1\/grep.1.html\">man7.org<\/a><\/p>\n<p><a href=\"https:\/\/apropostechsolutionscorp.ca\">-JS<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you want to weed out the &#8220;cannots.&#8221; The following is as I recall it. Yesterday I was in a server file system using the Linux terminal. I wanted to know about the folders the terminal could access, not the ones it couldn&#8217;t. Yet, there were more it couldn&#8217;t. I pipelined the command into 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":[89],"tags":[91,92,63,90],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-linux","tag-commands","tag-grep","tag-server","tag-terminal"],"_links":{"self":[{"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/comments?post=288"}],"version-history":[{"count":3,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":291,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/posts\/288\/revisions\/291"}],"wp:attachment":[{"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/media?parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/categories?post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apropostechsolutionscorp.ca\/blog\/wp-json\/wp\/v2\/tags?post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}