« Back to Index

Search, filter, cut, sort and get uniques + tee contents

View original Gist on GitHub

Tags: #shell

search and filter and cut and sort and get uniques while tee contents.bash

$ search -- "bf[_-]metrics" ./ | cut -d ':' -f 1 | tee /tmp/original_files_list.txt | cut -d '/' -f 1 | sort | uniq > /tmp/services.txt && cat /tmp/original_files_list.txt | grep -iE '^packages' | cut -d '/' -f 3 | sort | uniq > /tmp/packages.txt && rm /tmp/original_files_list.txt