Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sg(1) [freebsd man page]

SG(1)								   User Commands							     SG(1)

NAME
sg - execute command as different group ID SYNOPSIS
sg [-] [group [-c ] command] DESCRIPTION
The sg command works similar to newgrp but accepts a command. The command will be executed with the /bin/sh shell. With most shells you may run sg from, you need to enclose multi-word commands in quotes. Another difference between newgrp and sg is that some shells treat newgrp specially, replacing themselves with a new instance of a shell that newgrp creates. This doesn't happen with sg, so upon exit from a sg command you are returned to your previous group ID. CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool: SYSLOG_SG_ENAB (boolean) Enable "syslog" logging of sg activity. FILES
/etc/passwd User account information. /etc/shadow Secure user account information. /etc/group Group account information. /etc/gshadow Secure group account information. SEE ALSO
id(1), login(1), newgrp(1), su(1), gpasswd(1), group(5), gshadow(5). shadow-utils 4.5 01/25/2018 SG(1)

Check Out this Related Man Page

SG(1)                                                              User Commands                                                             SG(1)

NAME
sg - execute command as different group ID SYNOPSIS
sg [-] [group [-c ] command] DESCRIPTION
The sg command works similar to newgrp but accepts a command. The command will be executed with the /bin/sh shell. With most shells you may run sg from, you need to enclose multi-word commands in quotes. Another difference between newgrp and sg is that some shells treat newgrp specially, replacing themselves with a new instance of a shell that newgrp creates. This doesn't happen with sg, so upon exit from a sg command you are returned to your previous group ID. CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool: SYSLOG_SG_ENAB (boolean) Enable "syslog" logging of sg activity. FILES
/etc/passwd User account information. /etc/shadow Secure user account information. /etc/group Group account information. /etc/gshadow Secure group account information. SEE ALSO
id(1), login(1), newgrp(1), su(1), gpasswd(1), group(5), gshadow(5). shadow-utils 4.5 01/25/2018 SG(1)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Irix

I have an SGI running IRIX 6.5 The prob is when i login as user and open a file , it gives me error as "OUT OF MEMORY" when i su or login as root . THis error disappers I have lot of space in the System . Thanx DPai (7 Replies)
Discussion started by: DPAI
7 Replies

2. UNIX for Dummies Questions & Answers

Accessing Multi Hard Disk & theme

Hie, Im having 2 Questions. Please help. - Do Anyone know how to accessanother HDD using Linux? Ive tried many ways before but unable to do so. Im using 2 HDD, The main Hdd/Partition where my unix is are using Seagate HDD 20GB , another HDD is using Maxtor 20GB. From my seagate Hdd where my... (8 Replies)
Discussion started by: killerserv
8 Replies

3. UNIX for Dummies Questions & Answers

FTP configuration in Solaris 5.7

Hi everybody ! How can I configure the ftp in solaris systems ? Wich files ? To resume : I want to create a user wich can get from a ftp session running from a PC, some files without going up in the directories. If I attached the ksh or sh shell to the user, he can go wherever he wants. If I... (7 Replies)
Discussion started by: MarcoW
7 Replies

4. UNIX for Dummies Questions & Answers

mv files to /dev/null

im having trouble with moving files in a directory into /dev/null for file in $HOME/.trashcan/ do mv $file /dev/null done the error msg i get is: mv: /dev/null: not a directory. does anyone know how to fix this? thanks primal (16 Replies)
Discussion started by: primal
16 Replies

5. Programming

about msgget troble

hi,all i have in trouble about msgget. i create a queue and the program like blow: openMsg( pid_t key ) { .... int msgid; .... msgid=msgget(key,IPC_CREAT|IPC_EXCL|0666) if( msgid<=0 ){ fprintf( stdout,"%s,%d",strerror(errno),errno ); return -1; ... (9 Replies)
Discussion started by: subrain
9 Replies

6. UNIX for Dummies Questions & Answers

dmesg on a sun, unqualified host

Oct 22 01:01:47 sendmail: My unqualified host name unknown; sleeping for retry Oct 22 01:02:47 sendmail: unable to qualify my own domain name -- using short name how to resolve this error thanks (11 Replies)
Discussion started by: yls177
11 Replies

7. Programming

getting "mi_cmd_var_create: unable to create variable object" error msg

Hi, i am working in C in Fedora Eclipse 3.3.0 with gdb debugger. I am geting segmentation fault with an error message "mi_cmd_var_create: unable to create variable object" on debugging the program. What should I do to solve this problem? rgds, Dona_m (14 Replies)
Discussion started by: dona_m
14 Replies

8. Shell Programming and Scripting

How to display an error msg?

Hi friends, Please suggest a solution for this. A script has following things. echo "Enter P for PML" echo "Enter V for VVL" echo "Enter L for LNL" echo "Enter G for GDL" read choice echo ${choice} >> LOG_Daily.txt if operator enters anything other that P/V/L/G it should show an... (8 Replies)
Discussion started by: anushree.a
8 Replies

9. UNIX for Advanced & Expert Users

Getting 'Killed' msg

Can anyone explain? I start my unix session on AIX, run tcsh move to a particular directory, let say: cd /test/bin and next i run a command like: grep "test string" /test/bin/* to look for the string in any files in the directory. I am getting a response of Killed. Why is that... (16 Replies)
Discussion started by: gio001
16 Replies

10. UNIX for Advanced & Expert Users

how to lessen the threshold of diskusgae %

Hi experts, I found- $ tail -f /var/adm/messages .... .... Jan 17 05:16:31 server01b last message repeated 6 times Jan 17 05:17:05 server01c ufs: NOTICE: alloc: /var/fileserver:file system full but I checked with df -k and found /var/fileserver is only 49% is used. It means... (7 Replies)
Discussion started by: thepurple
7 Replies

11. Solaris

Error messgaes can not be redirected

# whoami 2>/dev/null whoami: not found # Why the error message not getting redirected to /dev/null ... The shell is # echo $SHELL /sbin/sh For other commands it is working # ls aaa 2>/dev/null # Is there any other way to redirect the err msg from whoami Thank you for your... (7 Replies)
Discussion started by: Anu_1
7 Replies

12. UNIX for Dummies Questions & Answers

suid sgid problem in script

hi I have problem with understanding setuid and setgid in system I have following users: $id -a marek uid=1001(marek) gid=1001(marek) groups=1001(marek),1002(uzivatelia) $id -a cepi uid=1000(cepi) gid=1000(cepi)... (7 Replies)
Discussion started by: wakatana
7 Replies

13. Shell Programming and Scripting

I/O Redirection: how can I redirect error msgs to a temp file

Hi there, I just want to know how can I redirect error msgs returned from running a command (e.g. nslookup) and then only print out the correct output using an if statement?. I've tried the following: where $a is a list of IPs. but I got all the error msgs printed out to screen and... (9 Replies)
Discussion started by: Abdulelah
9 Replies

14. HP-UX

Dmesg with date possible?

Hi there, I miss date information when executing # dmesg Is it possible to add this a date information to my results of # dmesg ? Best wishes (12 Replies)
Discussion started by: System
12 Replies

15. Programming

Msgget(2) returns 0 - a workaround fix

Greetings: I am posting this because my searches for this problem only came up with two posts and no helpful suggestions. I have a "solution" (read work-around hack) and have not tried yet to find a root cause, and may never because I am busy doing other things (read working to pay the bills). ... (10 Replies)
Discussion started by: mr_bandit
10 Replies