Results 1 to 3 of 3
Hi everyone,
Can somebody please tell me how can I make use of the following command:
find . -type f -name ".number" -exec rm -f {} \; , in order ...
- 08-26-2008 #1Linux User
- Join Date
- Jul 2007
- Location
- Greece
- Posts
- 277
the find command
Hi everyone,
Can somebody please tell me how can I make use of the following command:
find . -type f -name ".number" -exec rm -f {} \;, in order to delete files with a numeric extension?
For example, I have a folder that includes files ending to .shk and other files ending to .shk.123456, which basically are a back up copy of a software program I am using.
I only need the .shk files not the .shk.1233445 files.
Does anyone know how to define the numeric extension of a file in the bash command above?
Thanks a lot guys.
goude
- 08-26-2008 #2Linux User
- Join Date
- May 2008
- Location
- NYC, moved from KS & MO
- Posts
- 251
cd to the folder that contains the .shk and .shk.###### files, then
find . -type f ! -name '*shk' -exec rm -f {} \;
This will delete any files NOT ending in .shk under the current directory.
- 08-26-2008 #3Linux User
- Join Date
- Jul 2007
- Location
- Greece
- Posts
- 277
Thank you very much second mouse.


Reply With Quote