quota

systemLinux/Unix
The quota command is one of the most frequently used commands in Linux/Unix-like operating systems. quota Display disk usage and limits for a user or group

Quick Reference

Command Name:

quota

Category:

system

Platform:

Linux/Unix

Basic Usage:

quota [options] [arguments]

Common Use Cases

    Syntax

    quota [options] [user|group]

    Options

    Option Description
    -g, --group Display group quotas
    -u, --user Display user quotas (default)
    -v, --verbose Display quotas on all mounted file systems
    -s, --human-readable Display sizes in human-readable format (KB, MB, GB)
    -q, --quiet Print only if the user/group is over quota
    -F, --format=format Specify the quota format to use
    -f, --filesystem=filesystem Show quotas only for a specific filesystem
    -h, --help Display help message and exit
    -V, --version Output version information and exit

    Examples

    How to Use These Examples

    The examples below show common ways to use the quota command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

    # Basic Examples Basic
    quota
    Display disk usage and limits for the current user.
    quota -u username
    Display disk usage and limits for a specific user.
    quota -g groupname
    Display disk usage and limits for a specific group. # Advanced Examples Advanced quota -v Display quotas on all mounted file systems with verbose output. quota -s Display quotas in a more human-readable format. quota -q Print only if the user is over quota (quiet mode). quota -v -f /home Display quotas for the /home filesystem only. quota -g developers -v Show disk usage and limits for the developers group with verbose output. sudo quota -u username Run as root to view quotas for any user.

    Try It Yourself

    Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

    Understanding Syntax

    Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

    Notes

    The `quota` command is a Unix/Linux utility that displays disk usage and limits for users and groups. It's an essential tool for system administrators to monitor and enforce storage usage policies in multi-user environments. Quotas allow system administrators to control disk space usage by limiting the amount of disk space and/or the number of files that users or groups can use. This prevents any single user from consuming excessive disk resources and potentially disrupting system operation. The quota system in Linux works by tracking usage at the filesystem level and enforcing limits based on user and group identifiers. There are several types of limits that can be enforced: 1. Soft Limits: These act as warnings. Users can exceed soft limits temporarily for a grace period. 2. Hard Limits: These are absolute limits that cannot be exceeded under any circumstances. 3. Grace Periods: The time allowed for a user to reduce their usage below the soft limit before it's treated as a hard limit. The `quota` command displays these limits along with the current usage. By default, it shows information for the current user on all mounted filesystems that have quotas enabled. To use the quota system, several components need to be in place: - The kernel must support quotas - The filesystem must be mounted with quota options - Quota databases must be created and initialized (using `quotacheck`) - Quotas must be enabled (using `quotaon`) Administrators typically use complementary commands such as: - `edquota`: To edit user and group quotas - `repquota`: To generate reports on quota usage - `quotacheck`: To scan filesystems and update quota databases - `quotaon`/`quotaoff`: To enable or disable quotas Quotas are particularly useful in: - Shared hosting environments - Educational institutions with student accounts - Corporate environments with shared storage - Any multi-user system where fair allocation of resources is important The quota system helps prevent accidental or intentional denial of service situations where one user might fill up a filesystem, affecting all other users of the system.

    Related Commands

    These commands are frequently used alongside quota or serve similar purposes:

    Use Cases

    Learn By Doing

    The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the quota command works in different scenarios.

    $ quota
    View All Commands