Code:
$ gcc multipipe.c
$ strace ./a.out 2> log
<process runs and finishes>
$ egrep "(fork|execve|open|close|pipe|dup|read|write)\(" log
execve("./a.out", ["./a.out"], [/* 28 vars */]) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20m\1\0004\0\0\0"..., 512) = 512
close(3) = 0
pipe([3, 4]) = 0
[pid 9380] close(4 <unfinished ...>
[pid 9381] close(4 <unfinished ...>
[pid 9380] pipe( <unfinished ...>
[pid 9381] close(3 <unfinished ...>
[pid 9381] execve("/usr/local/bin/ls", ["ls"], [/* 28 vars */] <unfinished ...>
[pid 9380] close(5 <unfinished ...>
[pid 9381] execve("/usr/bin/ls", ["ls"], [/* 28 vars */] <unfinished ...>
[pid 9380] close(3 <unfinished ...>
[pid 9381] execve("/bin/ls", ["ls"], [/* 28 vars */] <unfinished ...>
[pid 9382] close(3Process 9383 attached
[pid 9380] close(4 <unfinished ...>
[pid 9382] close(5 <unfinished ...>
[pid 9382] close(4 <unfinished ...>
[pid 9382] execve("/usr/local/bin/tac", ["tac"], [/* 28 vars */] <unfinished ...>
[pid 9381] open("/etc/ld.so.cache", O_RDONLY <unfinished ...>
[pid 9382] execve("/usr/bin/tac", ["tac"], [/* 28 vars */] <unfinished ...>
[pid 9383] close(4 <unfinished ...>
[pid 9381] close(3 <unfinished ...>
[pid 9381] open("/lib/librt.so.1", O_RDONLY <unfinished ...>
[pid 9381] read(3, <unfinished ...>
[pid 9382] open("/etc/ld.so.cache", O_RDONLY <unfinished ...>
[pid 9382] close(3 <unfinished ...>
[pid 9381] close(3 <unfinished ...>
[pid 9382] open("/lib/libc.so.6", O_RDONLY <unfinished ...>
[pid 9383] execve("/usr/local/bin/less", ["less"], [/* 28 vars */] <unfinished ...>
[pid 9382] read(3, <unfinished ...>
[pid 9383] execve("/usr/bin/less", ["less"], [/* 28 vars */] <unfinished ...>
[pid 9381] open("/lib/libacl.so.1", O_RDONLY) = 3
[pid 9381] read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\32\0\0004\0\0\0"..., 512) = 512
[pid 9382] close(3 <unfinished ...>
[pid 9383] open("/etc/ld.so.cache", O_RDONLY <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9383] open("/lib/libncurses.so.5", O_RDONLY <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9381] close(3) = 0
[pid 9381] open("/lib/libc.so.6", O_RDONLY) = 3
[pid 9381] read(3, <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9383] open("/lib/libc.so.6", O_RDONLY <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9382] open("/tmp/tacpBNVeU", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600 <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9383] open("/lib/libdl.so.2", O_RDONLY <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9382] read(0, <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9381] close(3 <unfinished ...>
[pid 9381] open("/lib/libpthread.so.0", O_RDONLY <unfinished ...>
[pid 9381] read(3, <unfinished ...>
[pid 9381] close(3 <unfinished ...>
[pid 9381] open("/lib/libattr.so.1", O_RDONLY <unfinished ...>
[pid 9381] read(3, <unfinished ...>
[pid 9381] close(3 <unfinished ...>
[pid 9383] open("/etc/terminfo/x/xterm", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] close(3) = 0
[pid 9383] open("/usr/bin/.sysless", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] open("/etc/sysless", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] open("/home/username/.less", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] open("/home/username/.lesshst", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9383] open("/dev/tty", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9381] open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC <unfinished ...>
[pid 9381] close(3 <unfinished ...>
[pid 9383] write(1, "\33[?1049h\33[?1h\33=", 15 <unfinished ...>
[pid 9383] read(0, <unfinished ...>
[pid 9381] write(1, "a.out\nlog\nmultipipe.c\n", 22 <unfinished ...>
[pid 9382] read(0, <unfinished ...>
[pid 9381] close(1 <unfinished ...>
[pid 9382] write(3, "a.out\nlog\nmultipipe.c\n", 22 <unfinished ...>
[pid 9381] close(2 <unfinished ...>
[pid 9382] read(3, "a.out\nlog\nmultipipe.c\n", 22) = 22
[pid 9382] close(0) = 0
[pid 9382] write(1, "multipipe.c\nlog\na.out\n", 22 <unfinished ...>
[pid 9383] write(1, "multipipe.c\33[m\nlog\33[m\na.out\33[m\n", 31 <unfinished ...>
[pid 9382] close(1 <unfinished ...>
[pid 9383] read(0, <unfinished ...>
[pid 9382] close(2 <unfinished ...>
[pid 9383] write(1, "\33[7mlines 1-3/3 (END) \33[27m\33[K", 30 <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] write(1, "\r\33[K\33[?1l\33>\33[?1049l", 19) = 19
# what about just process 9383? what was it doing?
$ egrep "(fork|execve|open|close|pipe|dup|read|write)\(" log | grep 9383
[pid 9382] close(3Process 9383 attached
[pid 9383] close(4 <unfinished ...>
[pid 9383] execve("/usr/local/bin/less", ["less"], [/* 28 vars */] <unfinished ...>
[pid 9383] execve("/usr/bin/less", ["less"], [/* 28 vars */] <unfinished ...>
[pid 9383] open("/etc/ld.so.cache", O_RDONLY <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9383] open("/lib/libncurses.so.5", O_RDONLY <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9383] open("/lib/libc.so.6", O_RDONLY <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9383] open("/lib/libdl.so.2", O_RDONLY <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9383] open("/etc/terminfo/x/xterm", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] close(3) = 0
[pid 9383] open("/usr/bin/.sysless", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] open("/etc/sysless", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] open("/home/username/.less", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] open("/home/username/.lesshst", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] close(3 <unfinished ...>
[pid 9383] open("/dev/tty", O_RDONLY|O_LARGEFILE <unfinished ...>
[pid 9383] write(1, "\33[?1049h\33[?1h\33=", 15 <unfinished ...>
[pid 9383] read(0, <unfinished ...>
[pid 9383] write(1, "multipipe.c\33[m\nlog\33[m\na.out\33[m\n", 31 <unfinished ...>
[pid 9383] read(0, <unfinished ...>
[pid 9383] write(1, "\33[7mlines 1-3/3 (END) \33[27m\33[K", 30 <unfinished ...>
[pid 9383] read(3, <unfinished ...>
[pid 9383] write(1, "\r\33[K\33[?1l\33>\33[?1049l", 19) = 19
$