Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On a standard Linux distribution (e.g. Ubuntu) there is usually /etc/group and /etc/group-, where the second one is only readable by root.

man group only describes /etc/group.

Thus my question: What is the purpose of /etc/group-?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

It is a backup of the previous copy of the file that is version of the file before the last change. It is kept because it is very important file. You can delete it, but backups are a "good thing".

You can easily verify it. Try

# groupadd test
# diff /etc/group /etc/group-

There are other files also that are backed up the same way viz. /etc/passwd- /etc/shadow-.

All the user and group management utilities like useradd, usermod, userdel, groupmod, groupdel etc. create/update these backup files after successful execution of the command.

share|improve this answer
1  
Ok, I guess this would be another reason to modify /etc/group via group-commands and not directly editing it. –  maxschlepzig Nov 29 '11 at 8:38
    
@maxschlepzig, smart. I have updated my answer to mention the user and group management utilities. –  Sachin Divekar Nov 29 '11 at 8:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.