Linux Tutorial

Linux File/Directory Management

Linux Packaging And Compression

Vim Text Editor

Linux Text Processing

Linux Software Installation

Linux User/User Group Management

Linux Permission Management

Linux Filesystem Management

Linux Advanced Filesystem Management

Linux System Management

Linux Backup and Recovery

Linux System Service Management

Linux System Log Management

Linux Boot Management

LAMP/LNMP Environment

SELinux Management

Linux edquota Command: Modify The Disk Quota Of A User (group)

The edquota command is a Linux utility used to edit user and group disk quotas on file systems that support quota management. Disk quotas are a way to limit the amount of disk space and the number of inodes available to users and groups, ensuring fair use of shared resources and preventing abuse.

Here's a basic tutorial on how to use the edquota command:

  1. Edit a user's quota: To edit a user's disk quota, use the edquota command followed by the username. This command will open the quota configuration in the system's default text editor:

    sudo edquota username
    

    Replace "username" with the actual user's name.

  2. Edit a group's quota: To edit a group's disk quota, use the -g (group) option followed by the group name:

    sudo edquota -g groupname
    

    Replace "groupname" with the actual group's name.

  3. Set the disk space quota and inode limits: In the editor, you'll see a configuration that looks like this:

    Disk quotas for user username (uid 1001):
      Filesystem           blocks       soft       hard     inodes     soft     hard
      /dev/sda1          1234567          0          0      14567        0        0
    

    Set the soft and hard limits for both the disk space (blocks) and the number of inodes (files) by replacing the values. The soft limit is a warning threshold, while the hard limit enforces the restriction.

    For example, to set a soft limit of 10000 blocks and a hard limit of 15000 blocks, as well as a soft limit of 1000 inodes and a hard limit of 1500 inodes, the configuration would look like this:

    Disk quotas for user username (uid 1001):
      Filesystem           blocks       soft       hard     inodes     soft     hard
      /dev/sda1          1234567      10000      15000      14567     1000     1500
    

    Save the file and exit the editor to apply the changes.

  4. Copy one user's quota settings to another user: To quickly set another user's quota based on an existing user's configuration, use the -p (prototype) option:

    sudo edquota -p source_user target_user
    

    Replace "source_user" with the user whose quota settings you want to copy, and "target_user" with the user to whom the settings will be applied.

These are some basic examples of using the edquota command. By understanding how to edit and manage disk quotas for users and groups, you can effectively control the allocation of disk space and inodes on your Linux system.

  1. How to use edquota command in Linux: The edquota command in Linux is used to edit user and group disk quotas. To edit quotas for a user:

    edquota username
    

    Replace username with the actual username.

  2. Modifying disk quota for users with edquota: To modify the disk quota for a user:

    edquota username
    

    This opens an editor with the current quota settings for the specified user.

  3. Setting soft and hard disk limits using edquota: Within the edquota editor, set soft and hard limits for blocks and inodes. For example:

    Soft and Hard Blocks: 5000 6000
    Soft and Hard Inodes: 50 60
    

    This sets soft and hard limits for blocks and inodes.

  4. Editing user or group quotas in Linux: To edit user or group quotas:

    edquota username
    

    This command opens the editor for the specified user. For groups:

    edquota -g groupname
    
  5. Displaying current disk quotas with edquota: To display the current disk quotas:

    edquota -u username
    

    This shows the current quota settings for the specified user.

  6. Batch editing disk quotas for multiple users: To batch edit quotas for multiple users:

    edquota -u username1 username2 username3
    

    This opens the editor for each specified user, allowing you to set quotas in a batch.

  7. Using edquota to manage group quotas in Linux: To manage group quotas:

    edquota -g groupname
    

    This opens the editor for the specified group, allowing you to set group quotas.