c**o 发帖数: 166 | 1 I used to use
find / -name core -exec rm {} \;
to remove core files. But recently, the damn Redhat just created
tons of core.xxxxx files where xxxxx are some numbers, 3 to 5 digits.
What would be the simplest way to remove all those core files?
Thanks, |
c*****t 发帖数: 1879 | 2 ...
find / -name "core.[0-9]*" -exec rm {} \;
【在 c**o 的大作中提到】 : I used to use : find / -name core -exec rm {} \; : to remove core files. But recently, the damn Redhat just created : tons of core.xxxxx files where xxxxx are some numbers, 3 to 5 digits. : What would be the simplest way to remove all those core files? : Thanks,
|
a****y 发帖数: 1035 | 3 try:
find / -name 'core.*' -exec rm -i {} \;
【在 c**o 的大作中提到】 : I used to use : find / -name core -exec rm {} \; : to remove core files. But recently, the damn Redhat just created : tons of core.xxxxx files where xxxxx are some numbers, 3 to 5 digits. : What would be the simplest way to remove all those core files? : Thanks,
|
c**o 发帖数: 166 | 4 Both worked. But cocanut's solution find / -name "core.[0-9]*" -exec rm {} \;
should be safer.
If I also want to remove core files, do I have to run another find? Can we
safely use a single command to remove both core and core.dddd files?
Thanks,
______________________________________
reg learnning 中 ...
^_^
【在 a****y 的大作中提到】 : try: : find / -name 'core.*' -exec rm -i {} \;
|
s**s 发帖数: 242 | 5 then find / -name core\* -exec ...
but make sure no other files named as core...
【在 c**o 的大作中提到】 : Both worked. But cocanut's solution find / -name "core.[0-9]*" -exec rm {} \; : should be safer. : If I also want to remove core files, do I have to run another find? Can we : safely use a single command to remove both core and core.dddd files? : Thanks, : ______________________________________ : reg learnning 中 ... : ^_^
|
c**o 发帖数: 166 | 6 That's too dangerous, I think.
I only want to remove core and core.dddd files where dddd are some digits. I
don't even want to remove core.c file which as you may know is part of the
Apache source code.
\;
【在 s**s 的大作中提到】 : then find / -name core\* -exec ... : but make sure no other files named as core...
|
s**s 发帖数: 242 | 7 then use -o option
find -name core -o -name core.[0-9]\* -exec ...
【在 c**o 的大作中提到】 : That's too dangerous, I think. : I only want to remove core and core.dddd files where dddd are some digits. I : don't even want to remove core.c file which as you may know is part of the : Apache source code. : : \;
|
c**o 发帖数: 166 | 8 -o looks like a good option. But it seems that it is not working although the
manual page says that it should work.
I tried
find . -name file1 -o -name file2 -print
on Solaris 8 and Redhat 8.0, it only listed files2.
Am I missing anything here?
Thanks,
I
【在 s**s 的大作中提到】 : then use -o option : find -name core -o -name core.[0-9]\* -exec ...
|
s**s 发帖数: 242 | 9 sorry! should be:
find / \( -name file1 -o -name file2 \) -ls
【在 c**o 的大作中提到】 : -o looks like a good option. But it seems that it is not working although the : manual page says that it should work. : I tried : find . -name file1 -o -name file2 -print : on Solaris 8 and Redhat 8.0, it only listed files2. : Am I missing anything here? : Thanks, : : I
|
c**o 发帖数: 166 | 10 Thanks. I missed those two backslashes. :)
the
【在 s**s 的大作中提到】 : sorry! should be: : find / \( -name file1 -o -name file2 \) -ls
|