Naming your pipes
I am sure that we all have come across the vertical bar or pipe character |
; we can use this to create command pipelines, where the output of one command is piped to the input of another. As a simple demonstration, we can use the following commands as an illustration of how often we may use unnamed pipes:
$ yum list installed | grep plymouth
The first command, yum list installed
, lists all the installed packages which will be a considerable size; in order to reduce the content, we search for the string plymouth
with the second command grep
. The two lines of code are conjoined with an unnamed pipe. It is said to be unnamed as it is transient and only exists for the instance that the two commands run, which, incidentally, is much shorter than the life of a mayfly.
This transient nature may not be useful to us in every situation, in which case we can create named pipes, which are files with the pipe type. Files can be one of the following types:
- Regular file
- Directory
- Symbolic...