What's the use of newwgrp command in Linux?

Joined
Apr 16, 2023
Messages
149
Reaction score
16
Credits
1,460

I've been following this tutorial.

Code:
root@rhel65:~# mkdir prigroup
root@rhel65:~# cd prigroup/
root@rhel65:~/prigroup# touch standard.txt
root@rhel65:~/prigroup# ls -l
total 0
-rw-r--r--. 1 root root 0 Apr 13 17:49 standard.txt
root@rhel65:~/prigroup# echo $SHLVL
1
root@rhel65:~/prigroup# newgrp tennis
root@rhel65:~/prigroup# echo $SHLVL
2
root@rhel65:~/prigroup# touch newgrp.txt
root@rhel65:~/prigroup# ls -l
total 0
-rw-r--r--. 1 root tennis 0 Apr 13 17:49 newgrp.txt
-rw-r--r--. 1 root root   0 Apr 13 17:49 standard.txt
root@rhel65:~/prigroup# exit
exit
root@rhel65:~/prigroup#

I don't understand the use of newgrp. What purpose in system administration does it fulfill?
 


Basically, used when you only want certain people to have access to some part of your system.

Once created, you add them to the group.
 

Staff online

Members online


Top