Common unix admin commands

Posted in |

Some common unix admin stuff for Fedora 8.

Apache (httpd)

Edit conf file:
nano /etc/httpd/conf/httpd.conf
Restart:
/sbin/service httpd restart

Bash

Syntax check script
bash -n script.sh

Diff

Diff directory trees
diff -rq dir1 dir2

Logs

Log dir:
cd /var/log
Apache log dir:
cd /var/log/httpd
Log watching:
tail -f my_log

Postfix

Edit main configuration
nano /etc/postfix/main.cf
Edit master configuration
nano /etc/postfix/master.cf
Watch mail log
tail -f /var/log/maillog
Get version
/usr/sbin/postconf -d | grep mail_version

Users and Groups

Add new user and group
useradd username
Add new user with initial group
useradd -g group username
Add new user with supplementary groups
useradd -G group1,group2,... username
Add new group
groupadd groupname
Add existing user to group
usermod -a -G groupname username
Change user's primary group
usermod -g groupname username
Disallow user login
usermod -s /sbin/nologin username
List users
cat /etc/passwd
List groups
cat /etc/group

Webmin

Restart
/etc/webmin/restart
Submitted by Jonathan Mitchell on Tue, 05/26/2009 - 10:37

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
Let us know you are human.
15 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.