I have to change file/directory's ownership using chmod .I know only owners's username but want to change default group name simultaneosly . At this stage group name is not decided so I am putting same as username   chown -R username:username path_to_dirCommand may run for various sytems/users , So my concern is , will linux always has a pair  username(user):username(group) OR at some point this default group_name may give error.Although I have started to find GID from the user belongsid username | tr '(=)' ':' | awk -F: '{print $3}But for knowledge I want to know . Till now analysys of /etc/passwd /etc/groups except few users like shutdown,halt,sync,opeartor all users have listed in groups as well.EDIT 1:    id -gn username is also good option
Will there be always a pair of same UID and GID?
linux;chown;passwd
There is no guarantee that the groupname = username will exist.The most common scenario is that system administrators use on Linux is creating a new user locally on the system is without an explicit specification for the group, which means that the group will be created by default same as the user name and assign the user to have the default GID to be of the newly created group.This doesn't mean that another system administrator will follow this procedure and if you throw other naming services into the mix like NIS or LDAP the group assigned to be default will likely not be same as the new GID with groupname same as username.So you shouldn't rely on the fact that username=groupname