Question: What are the directory structure of unix?
- /: This is the root directory which should contain only the directories.
- /bin: Executable files are located here.
- /dev: Device drivers
- /etc: configuration files, valid user lists, groups, ethernet and hosts etc
- /lib: shared library files and sometimes other kernel-related files.
- /boot: files for booting the system.
- /home: home directory for users and other accounts
- /mnt: Used to mount other temporary file systems like CD/pendrive
- /proc: Contains all processes marked as a file by process number.
- /tmp: Holds temporary files used between system boots.
- /user: Used for miscellaneous purposes.
- /var: Typically contains log and print files.
- /sbin: Contains binary (executable) files.
- /kernel: kernel files
Question: How to create a new Group?
groupadd mynewgroup
Question: How to modify group name?
groupmod -n new_modified_group_name old_group_name
Question: How to delete group?
groupdel new_modified_group_name
Question: How to add a existing user to a group?
usermod -a -G mynewgroup username
-G Its for secondary group.
-g Its for primary group.
Question: How to change a User's Primary Group?
usermod -g groupname username
Question: How to list groups of loggined user?
groups
Question: How to list groups of other user?
groups username
Question: How to Create a New User and Assign a Group?
useradd -G examplegroup username
Question: How to assign a user multiple groups?
usermod -a -G group1,group2,group3 username