Here are some tips and tricks for CentOS I have been using for a while . I am currently using CentOS 5.9. So I am not sure whether these will work on CentOS 6, but I don’t see why not.
1. make an alias for “vi” to use “vim”.
I think it’s much more useful to use vim because of the syntax highlighting and colors. It makes reading code and config files much easier and pleasing.
$ vi ~/.bashrc
add the following to the end.
log out and log in again.
(If this doesn’t work, do the same thing to ~/.bash_profile)
2. forward root’s emails to an external email
$ vi /etc/aliases
find this line
uncomment it and change “marc” to your email address
then run this command to refresh the aliases.
Another way to do it is that you can add your email address to ~/.forward
3. change the hostname
$ vi /etc/sysconfig/newwork
change HOSTNAME to the new host name
$ vi /etc/hosts
add the new host name to the line starting with 127.0.0.1
$ hostname newhost
4. Change ls directory color
$ cp /etc/DIR_COLORS ~/.dir_colors $ vi .dir_colors
DIR 01;34 (dark blue) to
DIR 01:31 (red)
5. sendmail – configure the “From Address” as your domain name
$ vi /etc/mail/sendmail.mc
find these lines or add them if not exists
save the file. Then commit the change
$ m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Note: you might encounter this error when running the above command
$ /etc/mail/sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory
You need to install
$ yum install sendmail-cf
$ service sendmail restart