由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - Remove core.xxxx files?
相关主题
请教怎样使用tar压文件a question about shell quote
Help please: 2GB limit on file size请问unix/Linux中设置共享目录
怎么把一个文件的每一行合并到另外一个文件的对应行?diff -y: how to suppress the same lines?
Help! How to replace string in a variable?question about appending file
怎样将一个大文件分成两个文件?shell script for column operation
compare which file is newer请教一个文件处理的问题
[转载] comparehow to unpack .rpm file
怎么样循环执行一个命令?script问题----运行多个文件
相关话题的讨论汇总
话题: remove话题: files话题: core话题: name话题: find
进入Unix版参与讨论
1 (共1页)
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

1 (共1页)
进入Unix版参与讨论
相关主题
script问题----运行多个文件怎样将一个大文件分成两个文件?
rm filecompare which file is newer
how to remove a file with the name of -2 ?[转载] compare
请诊断:怎么样循环执行一个命令?
请教怎样使用tar压文件a question about shell quote
Help please: 2GB limit on file size请问unix/Linux中设置共享目录
怎么把一个文件的每一行合并到另外一个文件的对应行?diff -y: how to suppress the same lines?
Help! How to replace string in a variable?question about appending file
相关话题的讨论汇总
话题: remove话题: files话题: core话题: name话题: find