SG(1)
๐ SG(1) โ the sg girlies' manual ๐
okay so bestie, welcome to the sg page โจ this is a User Command, and honestly? it's giving "group ID glow-up" and I'm obsessed ๐
โจ NAME โจ
sg โ execute command as a different group ID ๐
๐ฆ SYNOPSIS ๐ฆ
sg [-] group [[-c] command]
๐ธ DESCRIPTION ๐ธ
okay so here's the tea ๐: the sg command is lowkey the same vibe as newgrp, except โ and this is the iconic part โ it actually accepts a command. slay.
That command gets executed with the /bin/sh shell, no cap. And here's the thing bestie: with most shells you might be running sg from, you have to wrap multi-word commands in quotes. literally just do it, it's not optional, it's the vibe. ๐
Another difference between newgrp and sg? okay so some shells treat newgrp specially โ they replace themselves with a whole new instance of a shell that newgrp creates. main character energy fr. That does NOT happen with sg, so when you exit from an sg command, you're returned to your previous group ID. no drama, no lingering, we go back to how it was. periodt. ๐
๐ OPTIONS ๐
the options that apply to the sg command are, bestie:
-,-lโ start the shell as a login shell. yes queen, log in properly ๐-cโ specify a command that will be invoked by the shell using its-c.
this one is the default; it's there for backward compatibility. so it's not doing the most, but it's holding it down for the old-school crew ๐ซถ
๐ CONFIGURATION ๐
the following configuration variables in /etc/login.defs change the behavior of this tool:
SYSLOG_SG_ENAB(boolean) โ enable"syslog"logging ofsgactivity. so like, yoursgdoings get logged. iykyk ๐
๐ง FILES ๐ง
/etc/passwdโ user account information. the basics ๐/etc/shadowโ secure user account information. the secretive one, we love a mystery ๐/etc/groupโ group account information. group chat energy fr fr ๐/etc/gshadowโ secure group account information. the locked group chat, private mode on ๐ฅ
โญ SEE ALSO โญ
id(1), login(1), newgrp(1), su(1), gpasswd(1), group(5), gshadow(5).
go read those too, bestie, they're all part of the lore ๐
and that's the whole page!! this one came from shadow-utils 4.19.0, dated 04/29/2026 โ so yeah, fresh, iconic, exactly the version you're holding. mwah ๐ ๐ฆโจ
๐ฆ where this page comes from
- fedora 44: shadow-utils 2:4.19.0-7.fc44 ยท BSD-3-Clause AND GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms