how to use rm to keep the files needed and delete others
I have a folder, ~/html.
I want to delete all the files except for the files which end with ".html" or ".htm". How could I use rm to achieve this? Thanks |
You can try the find command in this way:
Code:
find ~/html -mindepth 1 ! \( -name \*.html -o -name \*.htm \) -exec echo rm {} \; |
Thanks, it works very well
|
All times are GMT -5. The time now is 12:17 PM. |