Posts Tagged ‘system administration’

Linux Tips and Tricks – Check System Runlevel

January 15th, 2011


How To Check What Is the Runlevel of Linux System?



You can do this on several ways. Most common way is to issue a command:


# runlevel


Or you could check the content of some of these files:


For RH/Fedora/Centos:

#cat /etc/inittab


For Debian/Ubuntu:

#cat /etc/init/rc-sysinit.conf

Add Group/User In Linux

March 27th, 2010


Add Group


To add group to your system you can do this:

groupadd groupname


groupadd -g xxxx groupname


-g is switch to add custom GID (group ID) which is numerical (non-negative) value of the group’s ID. This value must be unique, unless the -o option is used. If not stated, GID will be default one (smallest ID value greater than 500 and greater than every other group). Values between 0 and 499 are typically reserved for system accounts

You can find more about this command and its options by running:

man groupadd



Add User


To add user you can simply do this:

useradd username


useradd -c “comment” -g groupname -m -s shell username


-c is switch to add custom comment. If not stated, no comment will be added to user info
-g is for custom groupname. If not stated, new user will be added to default groupname
-m or –create-home will create user’s home dir if it is not already created and files and folders contained in SKEL_DIR (usualy /etc/skel) will be copied there (unless -k option is prompted)
-s is shell option. You can find shell type binaries in /bin dir (i.e.: /bin/bash, /bin/tcsh, /bin/sh, etc.). If not stated, system will select the default shell

You can find out more about this command and its options by running:

man useradd