Scenario: I have a directory, let's call it A. In this directory I have a lot of text files, each text file lists the paths of a user installed package. Let's say text file 1 contains the following entries:
/usr
/usr/bin
/usr/bin/eat
/usr/sbin
/usr/sbin/eating
/usr/documents
/usr/documents/egg.pdf
Okay, the idea is to keep only the entries with the full paths of actual files and delete the rest. In this example I only want to keep the following entries:
/usr/bin/eat (this is an executable)
/usr/sbin/eating (this is a script)
/usr/documents/egg.pdf
So, a command that checks the contents of all the entries of the text files in directory A and delete all entries except the entries with full paths to the actual files (like indicated in the example).
Thanks