avatar
Remove core.xxxx files?# Unix - 噫吁兮,危乎高哉
c*o
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,
avatar
c*t
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,

avatar
a*y
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,

avatar
c*o
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 {} \;

avatar
s*s
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 中 ...
: ^_^

avatar
c*o
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...

avatar
s*s
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.
:
: \;

avatar
c*o
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 ...

avatar
s*s
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

avatar
c*o
10
Thanks. I missed those two backslashes. :)

the

【在 s**s 的大作中提到】
: sorry! should be:
: find / \( -name file1 -o -name file2 \) -ls

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。