免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4924 | 回复: 11
打印 上一主题 下一主题

[Mail] 我的postmaster邮箱中的邮件太多了,如何可以一下清空呢? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-09-23 21:52 |只看该作者 |正序浏览
我用
root@email cur]# rm -rf *
-bash: /bin/rm: Argument list too long

文件太多,有40000多个垃圾信。

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
12 [报告]
发表于 2004-09-29 15:16 |只看该作者

我的postmaster邮箱中的邮件太多了,如何可以一下清空呢?

我解釋一下另一個重點好了:
用 xargs/find ..等都能解,但追根究底在於 shell 對於
Max argument length of bash 的處理,
ls -la *
這個 * 號是 shell 解釋的,就好像你用
rm -f [a-z]* , 這個 [a-z]* 全部的組合在 shell 是有長度限制的
就一般的 linux 系統而言,是以 /usr/include/linux/limits.h 中的:

  1. #define ARG_MAX       131072    /* # bytes of args + environ for exec() */
复制代码


所以超出這個長度就會出現
-bash: your_command: Argument list too long

至於使用 xargs 的目的就是為了解決這個問題, xargs 的用法如同上面幾位說
的, man 一下

论坛徽章:
0
11 [报告]
发表于 2004-09-29 12:34 |只看该作者

我的postmaster邮箱中的邮件太多了,如何可以一下清空呢?

原帖由 "carelezz" 发表:

有这功夫问
不如看一下man

还挺押韵

论坛徽章:
0
10 [报告]
发表于 2004-09-29 11:13 |只看该作者

我的postmaster邮箱中的邮件太多了,如何可以一下清空呢?

原帖由 "spritecat" 发表:
|xargs
是什么意思呢?


有这功夫问
不如看一下man

NAME
     xargs -- construct argument list(s) and execute utility

SYNOPSIS
     xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
           [-L number] [-n number [-x]] [-s size] [utility [argument ...]]

DESCRIPTION
     The xargs utility reads space, tab, newline and end-of-file delimited
     strings from the standard input and executes utility with the strings as
     arguments.

     Any arguments specified on the command line are given to utility upon
     each invocation, followed by some number of the arguments read from the
     standard input of xargs.  The utility is repeatedly executed until stan-
     dard input is exhausted.

     Spaces, tabs and newlines may be embedded in arguments using single
     (`` ' '') or double (``"'') quotes or backslashes (``\'').  Single quotes
     escape all non-single quote characters, excluding newlines, up to the
     matching single quote.  Double quotes escape all non-double quote charac-
     ters, excluding newlines, up to the matching double quote.  Any single
     character, including newlines, may be escaped by a backslash.

论坛徽章:
0
9 [报告]
发表于 2004-09-29 11:04 |只看该作者

我的postmaster邮箱中的邮件太多了,如何可以一下清空呢?

|xargs
是什么意思呢?

论坛徽章:
0
8 [报告]
发表于 2004-09-29 09:41 |只看该作者

我的postmaster邮箱中的邮件太多了,如何可以一下清空呢?

应该是这样就可以的。用ls或者find命令
如下,进入那个目录,然后
ls * |xargs rm -rf

论坛徽章:
0
7 [报告]
发表于 2004-09-27 09:04 |只看该作者

我的postmaster邮箱中的邮件太多了,如何可以一下清空呢?

能否解释一下
echo * |xargs rm -rf

论坛徽章:
6
数据库技术版块每日发帖之星
日期:2015-10-11 06:20:00数据库技术版块每日发帖之星
日期:2015-10-12 06:20:00数据库技术版块每日发帖之星
日期:2015-10-15 06:20:00数据库技术版块每日发帖之星
日期:2015-10-30 06:20:00综合交流区版块每月发帖之星
日期:2015-12-02 14:59:01数据库技术版块每日发帖之星
日期:2015-12-15 06:20:00
6 [报告]
发表于 2004-09-26 12:14 |只看该作者

我的postmaster邮箱中的邮件太多了,如何可以一下清空呢?

如果,一个目录下文件过多,并且包含有多种文件,比如,文件夹,一般文件……就会出现参数列表过长的问题,用rm -rf *是不能够删除的。

得用组合命令才可以比如:
echo * |xargs rm -rf

论坛徽章:
0
5 [报告]
发表于 2004-09-24 16:56 |只看该作者

我的postmaster邮箱中的邮件太多了,如何可以一下清空呢?

啊。。。。

论坛徽章:
0
4 [报告]
发表于 2004-09-24 16:56 |只看该作者

我的postmaster邮箱中的邮件太多了,如何可以一下清空呢?

不需要重建目录的,系统会自动重建的
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP