I’m writing this post so I can keep a local copy of the neat trick a found on the web. This command allows you to refresh your Linux group membership without logging out. This is super useful if you’re doing development in directory owned by a service group, like www-data.

How to do it

exec su -l $USER

Source

An Edwards Research Blog