Let's say you want to cat the contents of a really big file, but want to view it a few bits at a time. Let's say one were to do the following:
$ cat /dev/sda1 | less
As a programmer of languages such as Java and ActionScript, when I look at that code I imagine Bash first running the command
cat /dev/sda1 (loading everything the command returns into RAM), and then running the command
less which has access to that really big "pseudo-variable" represented as
Is that the way Bash does things (meaning that command is a really bad idea if the file is larger than the amount of RAM on your system, and you should use another command), or does it have a way of optimising the piping of large amounts of data?