Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 20
    +11111 .. As the author of the currently accepted answer, I highly recommend this delightful complement. The specific examples elucidate my often abstract and wordy arguments, and the laugh you get from the author's early trepidation of file > a.sh is alone worth the time reading this :) Thanks for sharing! Commented Apr 6, 2019 at 6:13
  • 5
    In this invocation cat file | wc -c, wc needs to read stdin until EOF, counting bytes. But in this, wc -c < file, it just stats stdin, finds out it's a regular file and print st_size instead of reading any input. For a large file the difference in performance would be clearly visible. Commented Nov 19, 2019 at 22:51