I have a folder which in turn contain multiple sub-folders. All of these sub folders have a log folder. How to clear all the log files alone from all the log folders in these sub-directories using a single command from the parent directory?
Eg,
Folder/
Sub1/
Log/
Log1.txt
Log2.txt
Sub2/
Log/
Log10.txt
Log11.txt
How to clear these log files alone? Please note the sub folders sub1 and sub2 may contain other folders as well with some other files which should not be deleted. System is red hat Linux.
ls
ortree
to show us your directory structure. Or, at least, use the formatting tools to make it clear. I don't understand what is a subdirectory of what. Also, clarify what identified a log file. Is it any.txt
file? Any file name starting withLog
and a number? – terdon Apr 14 '16 at 10:37