1.\" Copyright (c) 1983, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" This code is derived from software contributed to Berkeley by 5.\" Robert Elz at The University of Melbourne. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" from: @(#)edquota.8 8.2 (Berkeley) 4/27/95 32.\" $NetBSD: edquota.8,v 1.16 2012/02/13 19:53:25 dholland Exp $ 33.\" 34.Dd January 29, 2012 35.Dt EDQUOTA 8 36.Os 37.Sh NAME 38.Nm edquota 39.Nd edit user quotas 40.Sh SYNOPSIS 41.Nm 42.Op Fl Hu 43.Op Fl f Ar file-system 44.Op Fl p Ar proto-username 45.Ar -d | 46.Ar username ... 47.Nm 48.Op Fl H 49.Fl g 50.Op Fl f Ar file-system 51.Op Fl p Ar proto-groupname 52.Ar -d | 53.Ar groupname ... 54.Nm 55.Op Fl Hu 56.Op Fl f Ar file-system 57.Op Fl h Ar block#/inode# 58.Op Fl s Ar block#/inode# 59.Op Fl t Ar block grace time/inode grace time 60.Ar -d | 61.Ar username ... 62.Nm 63.Op Fl H 64.Fl g 65.Op Fl f Ar file-system 66.Op Fl h Ar block#/inode# 67.Op Fl s Ar block#/inode# 68.Op Fl t Ar block grace time/inode grace time 69.Ar -d | 70.Ar groupname ... 71.Nm 72.Op Fl Hu 73.Fl c 74.Op Fl f Ar file-system 75.Ar username ... 76.Nm 77.Op Fl H 78.Fl g 79.Fl c 80.Op Fl f Ar file-system 81.Ar groupname ... 82.Sh DESCRIPTION 83.Nm 84is a quota editor. 85By default, or if the 86.Fl u 87flag is specified, 88one or more users may be specified on the command line. 89Unless 90.Fl h , 91.Fl s , 92or 93.Fl t 94are used, a temporary file is created for each user with an ASCII 95representation of the current disk quotas and grace time for that user. 96By default, quota for all quota-enabled file systems are edited; the 97.Fl f 98option can be used to restrict it to a single file system. 99An editor is invoked on the ASCII file. 100The editor invoked is 101.Xr vi 1 102unless the environment variable 103.Ev EDITOR 104specifies otherwise. 105.Pp 106The quotas may then be modified, new quotas added, etc. 107Setting a quota to \- or unlimited indicates that no quota should be imposed. 108Setting a quota to zero indicates that no allocation is permited. 109Setting a soft limit to zero with a unlimited hard limit 110indicates that allocations should be permitted on only a temporary basis. 111The current usage information in the file is for informational purposes; 112only the hard and soft limits, and grace time can be changed. 113.Pp 114Users are permitted to exceed their soft limits 115for a grace period that may be specified per user (or per-file system 116for quota version 1). 117Once the grace period has expired, 118the soft limit is enforced as a hard limit. 119The default grace period is one week. 120.Pp 121By default, disk quotas are in KB, grace time in seconds. 122Disk and inodes quota can be entered with a 123.Xr humanize_number 9 124suffix (K for kilo, M for mega, G for giga, T for tera). 125Time can be entered with Y (year), W (week), D (day), H (hour) and M (minute) 126suffixes. 127Suffixes can be mixed (see 128.Sx EXAMPLES 129below). 130If the 131.Fl H 132option if used, current quota, disk usage and time are displayed in 133a human-readable format. 134.Pp 135On leaving the editor, 136.Nm 137reads the temporary file and modifies the on-disk quotas 138to reflect the changes made. 139.Pp 140If the 141.Fl p 142flag is specified, 143.Nm 144will duplicate the quotas of the prototypical user 145specified for each user specified. 146.Pp 147The 148.Fl h , 149.Fl s , 150and 151.Fl t 152flags can be used to change quota limits (hard, soft and grace time, 153respectively) without user interaction, for usage in e.g. batch scripts. 154The arguments are the new block and inode number limit or grace time, 155separated by a slash. 156Units suffix may be used, as in the editor above. 157.Pp 158If the 159.Fl g 160flag is specified, 161.Nm 162is invoked to edit the quotas of 163one or more groups specified on the command line. 164.Pp 165With quota version 2, there is a per-file system user or group 166default quota to be copied to a user or group quota on the first 167allocation. 168The 169.Fl d 170flag adds the default quota to the list of users or groups to edit. 171.Pp 172For quota version 1, there is no default block/inode quota, and no 173per-user/group grace time. 174To edit the file system-wide grace time, use 175.Fl d . 176.Pp 177On quota2-enabled file systems, the 178.Fl c 179flag cause edquota to clear quota entries for the specified users or groups. 180If disk or inode usages is not 0, limits are reverted to the default quota. 181If disk and inode usages are 0, the existing quota entries are freed. 182.Pp 183Only the super-user may edit quotas. 184.Sh EXAMPLES 185Edit quotas for group games on all quota-enabled file systems: 186.Dl edquota -g 187Set 4MB hard block limit, 2MB soft block limit, 2048 inode hard limit, 1881024 inode soft limit, 2 weeks and 3 days (or 17 days) block and inode grace 189time for the default quotas on file system 190.Pa /home : 191.Dl edquota -h 4M/2k -s 2M/1k -t 2W3D/2W3D -f /home -u -d 192.Sh SEE ALSO 193.Xr quota 1 , 194.Xr humanize_number 3 , 195.Xr libquota 3 , 196.Xr fstab 5 , 197.Xr quotacheck 8 , 198.Xr quotaon 8 , 199.Xr quotarestore 8 , 200.Xr repquota 8 201