I have a folder containing multiple text files.
apple.txt, book.txt, teeth.txt etc.
I created a bash script with multiple sed commands to process every text file in place as follows:
...
find /directory/. -type f -exec sed -i 's/one/two/g' {} \;
...
These lines work fine.
Is there a way to process all the individual text files in place in a similar manner (single command) to perform these operations:
sort lines from longest to shortest string (each line contains one string - no spaces).
remove any duplicate lines.