This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
尝试
df -h
更好的是:
df -h .
或df -h path-to-file
Try
df -h
Better yet:
df -h .
ordf -h path-to-file
其他人讨论的“df”命令只是等式的一半。 知道文件系统有可用空间并不意味着用户可以访问该空间。
您还可以使用以下命令:
找出当前文件系统上的可用空间。 “df”足够聪明,可以为您遍历树并报告它。 如果您想检查配额(见下文),那么您可以处理 df 的输出以查找要检查配额的文件系统。
可能没有空闲 inode (df -i $PWD),可能有为超级用户保留的块(默认情况下,在 ext2/3/4 上,总数的 5% 保留给 root)。 我相信 df 显示了包括保留块在内的可用空间,因此您看到的数字实际上比您不是 root 时可用的数字要高。
用户可能有配额限制。 由于存储成本如此之低,配额限制现在已经不太常见了,但也值得使用配额命令进行检查。
The 'df' command others discuss is only half the equation. Knowing the file system has free space does not imply that the user has access to the space.
You can also use the command:
To find out the free space on the current file system. 'df' is smart enough to walk the tree for you and report it. If you want to check quotas (see below) then you can process the output of df to find the file system to check the quota on.
There may be no free inodes (df -i $PWD), there could be reserved blocks for the super user (by default on ext2/3/4, 5% of the total is reserved for root). I believe df shows the free space including the reserved blocks, so the number you see is actually higher than is available if you're not root.
The user may have quota restrictions. Quota restrictions is far less common these days since the cost of storage is so low, but it's worth checking with the quota command too.
我将使用以下内容来与所有不同的 df(1) 及其输出更加兼容:
不需要使用 tail(1) 因为正则表达式匹配。
I'd use the following to be more compatible with all the different
df(1)
and their output:No need to use
tail(1)
becaus eof the regex matching.