The newgrp Command

The newgrp command changes the group id and is equivalent to 'exec /bin/newgrp group'. In this example, the group id is changed from users to networks:

					$ id
					uid=100(anatole) gid=101(users)
					$ newgrp networks
					uid=100(anatole) gid=12(networks)
				

Without arguments, newgrp resets the group-id to the default:

					$ newgrp
					uid=100(anatole) gid=101(users)
				

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.