I know that this is an old post, but i am pretty new at this and i've found an easy way to find all files of a certain extension in a directory and its children subdirectories.
Well you first navigate to the parent Directory then find . -name '*.sql' and that will find you all files with .sql extension in the directories and its subdirectories.
In my case i wanted to delete all .xml files in the directory and its subdirectories, so what i did more is that i added remove as in here find . -name '*.xml' | xargs rm
Or...
For example
Or
(where ~ equates to /home/your_username/), or...
and so forth.
Run this in the command line:
Change '/' to the directory you want to search.
The
find
command is able to accomplish the task without grep (using extra options), but I find the above usage more convenient.In order, the above command:
cd /
)find
)| grep '\.sql$'
)I know that this is an old post, but i am pretty new at this and i've found an easy way to find all files of a certain extension in a directory and its children subdirectories. Well you first navigate to the
parent Directory
thenfind . -name '*.sql'
and that will find you all files with .sql extension in the directories and its subdirectories.In my case i wanted to delete all .xml files in the directory and its subdirectories, so what i did more is that i added remove as in here
find . -name '*.xml' | xargs rm
Hope this help someone :)
If it is not installed, then previously install it with: