3 ms·
What is a use case for this?
by neolog 6y ago
What is a use case for this?
- carapace 6y agoI 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.
- tgv 6y agoAnother use case is finding words with a common ending. Can be used for finding similar inflections or rhymes (in which case you'd use some form of phonetic alphabet, which fits in normal ASCII, so the problem wouldn't arise there). I also once used it for a (very) quick&dirty spell correction algorithm, which had to run in less than 1s and had to read all data from CD-ROM.