Overview
quota displays the disk space and inode usage for users or groups on a specific file system, along with configured soft/hard limits and grace periods. This information is essential for disk space management.
Key Features
- Check disk quotas per user
- Check disk quotas per group
- Output in human-readable format
- Provide soft/hard limit and grace period information
Key Options
The main options for the quota command control how quota information is queried.
Query and Output Formats
Generated command:
Try combining the commands.
Description:
`quota` Executes the command.
Combine the above options to virtually execute commands with AI.
Usage Examples
Learn how to effectively query disk quota information through various usage examples of the quota command.
Check Current User's Quotas
quota
Displays the disk quota information for the currently logged-in user.
Check Quotas in Human-Readable Format
quota -s
Displays disk usage and quotas in an easy-to-read format using K, M, G units.
Check Specific User's Quotas
quota -u john
Displays the disk quota information for a specified user (e.g., 'john').
Check Specific Group's Quotas
quota -g developers
Displays the disk quota information for a specified group (e.g., 'developers').
View User Quotas for All File Systems Verbose
quota -uvs
Displays the current user's quotas for all mounted file systems in a detailed and human-readable format.
Installation
The quota command may not be installed by default on most Linux distributions. You can install it using the following commands.
Debian/Ubuntu Based Systems
sudo apt update && sudo apt install quota
Install the quota package using the apt package manager.
RHEL/CentOS/Fedora Based Systems
sudo yum install quota
# or
sudo dnf install quota
Install the quota package using the yum or dnf package manager.
Tips & Notes
Useful tips and points to note when using the quota command.
Enabling the Quota System
For the quota command to work correctly, the quota system must be enabled on the relevant file system. This is typically done by adding the `usrquota` or `grpquota` option to the `/etc/fstab` file, remounting the file system with `mount -o remount /path/to/filesystem`, and then running the `quotacheck` command to activate it.
- Add `usrquota` or `grpquota` option to the file system
- Remount the file system
- Create quota database with the `quotacheck` command
Permissions
Regular users can only check their own quotas. Root privileges are required to check the quotas of other users or groups.
- Regular user: Can only check their own quotas
- Root user: Can check quotas for all users/groups
Understanding Soft/Hard Limits
Quotas consist of soft and hard limits.
- Soft Limit: This is the point where warnings begin. Exceeding this limit initiates a grace period.
- Hard Limit: This is the absolute limit that cannot be exceeded. Once reached, no more data can be written to disk.
- Grace Period: This is the time given to a user after exceeding the soft limit before hitting the hard limit. If usage is not reduced within this period, the soft limit will start behaving like a hard limit.