LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (http://www.linuxquestions.org/questions/aix-43/)
-   -   how to use find command to use effectively. (http://www.linuxquestions.org/questions/aix-43/how-to-use-find-command-to-use-effectively-898714/)

shravee 08-22-2011 03:20 AM

how to use find command to use effectively.
 
hi,

I have few core files in my working dir.

the dir has foll type of files

core.3423.232.tmp
core.332.3423.txt
core.42342.342.dmp
core.3432.342234.gz
javacore.3423432.3423
core.43243.3424

out of these type of core files i need to remove only the type which is shown in bold.
i.e. core.43243.3424


the nos are not the same, they vary.

can someone please help on the same. should i use find command or a normal ls and then grep and rm will work ?

so far, I have used the foll cmd to list all core files. I am unaware now to exclude the unwanted core files . Plz help.

find . \( -name core\* -type f \) -exec ls {} \;



rgds

shravee

lithos 08-22-2011 03:49 AM

some find tips

druuna 08-22-2011 03:54 AM

Hi,

Tested on a none AIX system:
Code:

find . -type f -name "core.[0-9]*" ! -name "core.[0-9]*[a-z]*"
The ! -name "core.[0-9]*[a-z]*" part excludes parts.

Hope this helps.


All times are GMT -5. The time now is 12:43 AM.