The Linux command -g is used to specify the group ID for the group. This command is used to set the group ID of a file or directory to the specified group ID. It is also used to set the group ID of a user to the specified group ID. This command is useful for setting permissions on files and directories, as well as for setting user access rights. It is also used to set the group ID of a process to the specified group ID.
chgrp -R -g
chgrp -R -g 1000 /home/user/Documents
groupmod command in Linux allows you to modify an existing group by changing its Group ID (GID). To use this command, you must be logged in as the root user.
groupmod -g GID group
GID is the new Group ID you want to assign to the group, and
group is the name of the group you want to modify.
groupmod -g 500 mygroup
This command will change the GID of the group
mygroup to 500.
Note: You should be careful when changing the GID of a group, as it can cause problems if the GID is already in use by another group.