<story><title>Nushell.sh ls | where size &gt; 10mb | sort-by modified</title><url>https://www.nushell.sh/</url></story><parent_chain><item><author>mtlmtlmtlmtl</author><text>For some reason I never liked to do it the &amp;quot;right way&amp;quot;. First of all it doesn&amp;#x27;t seem to actually matter.&lt;p&gt;But most of all the cat way just aligns with my mental model more. Data flows left to right, if you catch my drift.&lt;p&gt;It also makes it easier to add arguments to the end if re-running it.</text></item><item><author>codetrotter</author><text>Historically we would discourage shell users from&lt;p&gt;&lt;pre&gt;&lt;code&gt;    cat somefile.txt | whatever
&lt;/code&gt;&lt;/pre&gt;
and instead tell them to use either&lt;p&gt;&lt;pre&gt;&lt;code&gt;    whatever &amp;lt; somefile.txt
&lt;/code&gt;&lt;/pre&gt;
or, if the command accepts input file names as arguments then use those like&lt;p&gt;&lt;pre&gt;&lt;code&gt;    whatever somefile.txt
&lt;/code&gt;&lt;/pre&gt;
or&lt;p&gt;&lt;pre&gt;&lt;code&gt;    whatever -i somefile.txt
&lt;/code&gt;&lt;/pre&gt;
etc&lt;p&gt;But perhaps in fish, “useless use of cat” is not so useless and would be recommended?&lt;p&gt;(I mean aside from the fact that they seem to recommend their “open” command, and so they probably prefer their own “open” over “cat”.)</text></item><item><author>akira2501</author><text>So,  &amp;#x27;&amp;gt;&amp;#x27; isn&amp;#x27;t for redirection anymore.  How does one do that?&lt;p&gt;&lt;pre&gt;&lt;code&gt;    open foo.txt | append &amp;quot;world&amp;quot;| save --raw foo.txt
&lt;/code&gt;&lt;/pre&gt;
Oh.</text></item></parent_chain><comment><author>kccqzy</author><text>Besides it&amp;#x27;s also a fail-safe way to make sure the program doesn&amp;#x27;t modify the original file.&lt;p&gt;&lt;pre&gt;&lt;code&gt;    random-app .&amp;#x2F;myfile.txt 
&lt;/code&gt;&lt;/pre&gt;
The app opens the file on its own. It could decide to write to it.&lt;p&gt;&lt;pre&gt;&lt;code&gt;    cat .&amp;#x2F;myfile.txt | random-app
&lt;/code&gt;&lt;/pre&gt;
The app receives chunks of the file from a pipe. It doesn&amp;#x27;t know where the original file is.&lt;p&gt;This is especially useful if you aren&amp;#x27;t sure the program will by default modify the file (such as formatters).</text></comment>
<story><title>Nushell.sh ls | where size &gt; 10mb | sort-by modified</title><url>https://www.nushell.sh/</url></story><parent_chain><item><author>mtlmtlmtlmtl</author><text>For some reason I never liked to do it the &amp;quot;right way&amp;quot;. First of all it doesn&amp;#x27;t seem to actually matter.&lt;p&gt;But most of all the cat way just aligns with my mental model more. Data flows left to right, if you catch my drift.&lt;p&gt;It also makes it easier to add arguments to the end if re-running it.</text></item><item><author>codetrotter</author><text>Historically we would discourage shell users from&lt;p&gt;&lt;pre&gt;&lt;code&gt;    cat somefile.txt | whatever
&lt;/code&gt;&lt;/pre&gt;
and instead tell them to use either&lt;p&gt;&lt;pre&gt;&lt;code&gt;    whatever &amp;lt; somefile.txt
&lt;/code&gt;&lt;/pre&gt;
or, if the command accepts input file names as arguments then use those like&lt;p&gt;&lt;pre&gt;&lt;code&gt;    whatever somefile.txt
&lt;/code&gt;&lt;/pre&gt;
or&lt;p&gt;&lt;pre&gt;&lt;code&gt;    whatever -i somefile.txt
&lt;/code&gt;&lt;/pre&gt;
etc&lt;p&gt;But perhaps in fish, “useless use of cat” is not so useless and would be recommended?&lt;p&gt;(I mean aside from the fact that they seem to recommend their “open” command, and so they probably prefer their own “open” over “cat”.)</text></item><item><author>akira2501</author><text>So,  &amp;#x27;&amp;gt;&amp;#x27; isn&amp;#x27;t for redirection anymore.  How does one do that?&lt;p&gt;&lt;pre&gt;&lt;code&gt;    open foo.txt | append &amp;quot;world&amp;quot;| save --raw foo.txt
&lt;/code&gt;&lt;/pre&gt;
Oh.</text></item></parent_chain><comment><author>Arnavion</author><text>&amp;gt;But most of all the cat way just aligns with my mental model more. Data flows left to right, if you catch my drift.&lt;p&gt;Using `&amp;lt;` doesn&amp;#x27;t change that model. You can write `&amp;lt; somefile.txt whatever`. I always write my commandlines as `&amp;lt;in_file cmd1 | cmd2 | cmd3 &amp;gt;out_file`&lt;p&gt;(Though annoyingly this doesn&amp;#x27;t work for feeding input to while loops. `&amp;lt; &amp;lt;(echo a; echo b; echo c;) while read -r foo; do echo &amp;quot;$foo&amp;quot;; done` is invalid syntax; it needs to be `while read -r foo; do echo &amp;quot;$foo&amp;quot;; done &amp;lt; &amp;lt;(echo a; echo b; echo c;)`)</text></comment>