I have this bash commands to filter words in a text file (file1 in the example)
Until now i have to use two separate commands to get the result i want
sed -n "SAMPLETEXT" file1 > file2
sort file2 | uniq -c > file2.tmp && mv file2.tmp file2.txt
because i need to filter out lines with certain strings from file1 and then count all equal lines.
is there a way to do that all in one command to show the output in the console so that i dont need to even create a "file2"?