Can someone explain to me the piping concept in exersize 7?


#1

I'm not really understanding the way the pipe works or how it's being used by redirecting the outputs and inputs. (also first time posting if i did something wrong sorry)


#2

Programs communicate by reading and writing text. | is used to send the output of one into another. Similarly, > sends to file and < reads from file

the | cat part is redundant, can send wc's output directly to the file, cat is just repeating it there.

This is equivalent:

wc < volcanoes.txt > islands.txt

#3

I was wondering pretty much the same thing richt now, all the "cat" is a bit confusing here.

Would it work if we just did it like this:

wc volcanoes.txt > islands.txt

?