Linux Cheatsheet

This is just a collection of Linux commands that I compiled in one spot so I wouldn't keep having to go hunting for them. There are lots of different installs out there, so some of this might not work on your server, but hopefully it does and saves you some time.

How to Create a Symbolic Link

ln -s target linkname

How to Allow a Group (examplegroup) Access to a Folder

chown apache.examplegroup folder -R
chmod 775 folder -R

How to Block a Group (examplegroup) From a Folder

chown apache.examplegroup folder -R
chmod 705 folder -R

How to Restart Email Systems

sudo service dovecot restart
sudo service sendmail restart

How To Restart Apache

sudo /etc/rc.d/init.d/httpd restart

How to Empty Your Mailbox

cd /var/spool/mail/
tail username > username

How to Add a User

/usr/sbin/useradd newusername
passwd newusername

How to Delete a User

/usr/sbin/userdel -r user

How to See All Users

vi /etc/passwd

How to Add a Domain

cd /etc/httpd/conf/virtuals
/etc/rc.d/init.d/httpd restart


Be the first to leave a comment.

Leave a Comment

Name and email are required. Your email will not be published.

This post was published on October 3rd, 2011 by Robert James Reese in the following categories: Apache, Linux.

Before using any of the code or other content in this post, you must read and agree to our Terms & Conditions.

Copyright © 2014, Ink Plant. All rights reserved.