Pipe in Linux
Pipes are used to redirect a stream from one program to another program
Last updated
Pipes are used to redirect a stream from one program to another program
Last updated
-> The output of one commad redirect it to the input of other command
We use '|' symbol to separate two commands. Output of first command passed to second command
The command lists all files in a directory in a single column i.e. a single line represents name of one file.
This prints the number lines in file. Together the commands will print the number of files in a directory.
Combining 2 files using cat command and then sorting them using pipe
We can only use uniq
command with sorted data only
head -37
to view first 37 lines , tail -7
to view last 7 lines from the 37 lines, which makes 30-37
tee
command reads from stdin and saves the content to a file and also displays it to stdout