Files
shadow/man/man1/sg.1
2026-02-02 07:32:15 +01:00

116 lines
2.7 KiB
Groff

'\" t
.\" Title: sg
.\" Author: Julianne Frances Haugh
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\" Date: 02/01/2026
.\" Manual: User Commands
.\" Source: shadow-utils 4.19.3
.\" Language: English
.\"
.TH "SG" "1" "02/01/2026" "shadow\-utils 4\&.19\&.3" "User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
sg \- execute command as different group ID
.SH "SYNOPSIS"
.HP \w'\fBsg\fR\ 'u
\fBsg\fR [\fI\-\fR] \fIgroup\fR [[\fI\-c\fR]\ \fIcommand\fR]
.SH "DESCRIPTION"
.PP
The
\fBsg\fR
command works similar to
\fBnewgrp\fR
but accepts a command\&. The command will be executed with the
/bin/sh
shell\&. With most shells you may run
\fBsg\fR
from, you need to enclose multi\-word commands in quotes\&. Another difference between
\fBnewgrp\fR
and
\fBsg\fR
is that some shells treat
\fBnewgrp\fR
specially, replacing themselves with a new instance of a shell that
\fBnewgrp\fR
creates\&. This doesn\*(Aqt happen with
\fBsg\fR, so upon exit from an
\fBsg\fR
command you are returned to your previous group ID\&.
.SH "OPTIONS"
.PP
The options which apply to the
\fBsg\fR
command are:
.PP
\fB\-\fR, \fB\-l\fR
.RS 4
Start the shell as a login shell\&.
.RE
.PP
\fB\-c\fR
.RS 4
Specify a command that will be invoked by the shell using its
\fB\-c\fR\&.
.sp
This is the default; for backward compatibility\&.
.RE
.SH "CONFIGURATION"
.PP
The following configuration variables in
/etc/login\&.defs
change the behavior of this tool:
.PP
\fBSYSLOG_SG_ENAB\fR (boolean)
.RS 4
Enable "syslog" logging of
\fBsg\fR
activity\&.
.RE
.SH "FILES"
.PP
/etc/passwd
.RS 4
User account information\&.
.RE
.PP
/etc/shadow
.RS 4
Secure user account information\&.
.RE
.PP
/etc/group
.RS 4
Group account information\&.
.RE
.PP
/etc/gshadow
.RS 4
Secure group account information\&.
.RE
.SH "SEE ALSO"
.PP
\fBid\fR(1),
\fBlogin\fR(1),
\fBnewgrp\fR(1),
\fBsu\fR(1),
\fBgpasswd\fR(1),
\fBgroup\fR(5), \fBgshadow\fR(5)\&.