Linux查询已建立好的磁盘配额(quota和repquota命令)
查询磁盘配额有两种方法:
- 使用 quota 命令查询用户或用户组的配额;
- 使用 repquota 命令查询整个分区的配额情况。
quota 命令查询用户或用户组配额
[root@localhost~] # quota [选项] [用户名或组名]
选项:- -u 用户名:查询用户配额;
- -g 组名:查询组配额;
- -v:显示详细信息;
- -s:以习惯单位显示容量大小,如M、G;
[root@localhost 〜]# quota -uvs lamp1
Disk quotas for user lamp1 (uid 500):
Filesystem blocks quota limit grace files quota limit grace
/dev/sda3 20 0 0 6 0 0
/dev/sdbl 0 40000 50000 0 8 10
#查看lamp1用户的配额值
[root@localhost ~]# quota -uvs lamp2
Disk quotas for user lamp2 (uid 501):
Filesystem blocks quota limit grace files quota limit grace
/dev/sda3 36752 0 0 2672 0 0
/dev/sdbl 0 245M 293M 0 0 0
#查看lamp2用户的配额值
repquota命令查询文件系统配额
[root@localhost ~] # repquota [选项] [分区名]
选项:- -a:依据 /etc/mtab 文件查询配额。如果不加 -a 选项,就一定要加分区名;
- -u:查询用户配额;
- -g:查询组配额;
- -v:显示详细信息;
- -s:以习惯单位显示容量太小;
[root@localhost ~] # repquota -augvs
*** Report for user quotas on device /dev/sdbl
#用户配额信息
Block grace time: 8days; Inode grace time: 8days
Block limits File limits
User used soft hard grace used soft hard grace
root -- 13 0 0 2 0 0
lampl -- 0 40000 50000 0 8 10
lamp2 -- 0 245M 293M 0 0 0
lamp3 -- 0 245M 293M 0 0 0
#用户的配额值
Statistics:
Total blocks: 7
Data blocks: 1
Entries: 4
Used average: 4.000000
*** Report for group quotas on device /dev/sdbl
#组配额信息
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
Group used soft hard grace used soft hard grace
root -- 13 0 0 2 0 0
brother -- 0 440M 489M 0 0 0
#组的配额值
Statistics:
Total blocks: 7
Data blocks: 1
Entries: 2
Used average: 2.000000