hello,
I have to write a unix script and I am really not familiar with it and need help.
I have a root directory, inside it I have a lot of other directories.
Each directory contains txt files.
I have to go through all the directories and all the files.
If a file contains the phrase "file information" I want to keep the file. If the file does not contain it, I want to delete the file.
Then, If all the files of a directory have been deleted, and the directory is empty, I want to delete the directory.
How can I write a script like that?
Thanks