The pipe symbol |
always means "use the output of the previous command as the input for the following command". When multiple pipes are strung along in sequence, the piping occurs from left to right (A | B | C
means: take the output of A, and put it into B. Then, take the output of B, and put it into C). It may help to visualize parentheses around usages of pipes, starting from the left ((A | B) | C
has a clearer order of operations).
In your specific case, the command says
- Tell me what files have the word "and" in them in the current directory.
- Only show me the first 10 matches you find.
- Only show me the last 5 of the first 10 matches.
In other words, it's asking to see the fifth through tenth files it finds that have the word "and" in the current directory.