3 ms·
I did this yesterday. find ... | rev | sort | rev > sorted-filelist I had several directories and I wanted to pull out the unique list of certain files (T
by carapace 6y ago
I did this yesterday.
find ... | rev | sort | rev > sorted-filelist
I had several directories and I wanted to pull out the unique list of certain files (TrueType fonts) across all of them, regardless of which subdirs they were in. (I'm omitting the find CLI args for clarity; the command just finds all the *.ttf (case-insensitive) files in the dirs.)
By reversing the lines before sorting them (and un-reversing them) they come out sorted and grouped by filename.
- neolog 6y agoThat's clever. But in a programming language (instead of a composition of coreutils), I would use a filename() function or something.