What files are located under /usr/local?

Today we will learn that what files are located under /usr/local. These files are safe from being overwritten by software updates. It may be used to install your programs and software. In other words, /usr/local contains the files which are not related to the operating system.

The following directories, or symbolic links to directories, must be in /usr/local

Directory

Description

bin Local binaries
etc Host-specific system configuration for local binaries
games Local game binaries
include Local C header files
lib Local libraries
man Local online manuals
sbin Local system binaries
share Local architecture-independent hierarchy
src Local source code

No other directories, except those listed below, may be in /usr/local after first installing a FHS-compliant system.

So I hope you know what is /usr/local folder is meant for and what files are located under /usr/local. If you have information on this, keep the comments coming.

Receive root login alerts

To receive an email every time when someone login into SSH as root.

Edit .bash_profile (located in /root directory)

root@justgeek~]# vi /root/.bash_profile

Enter the following line in it.

echo ‘ALERT – Root Shell Access on:’ `date` `who` | mail -s “Alert: Root Access from `who | awk ‘{print $6}’`”mail@youremail.com

Important Exim Commands

Here are few Important Exim Commands, which are used daily

01] To print the email queue.

root@justgeek~]# exim -bpc

02] To remove a particular message

root@justgeek~]# exim -Mrm message-id

03] Force delivery of single email

root@justgeek~]# exim -M email-id

04] To remove all messages from the queue, enter:

exim -bp | exiqgrep -i | xargs exim -Mrm

05] Print what Exim is doing right now:

root@justgeek~]#  exim -bp | exiqsumm

06] To delete all frozen mails

root@justgeek~]# exiqgrep -z -i | xargs exim -Mrm

07] Freeze all queued mail from a given sender:

root@justgeek~]#exiqgrep -i -f luser@example.tld | xargs exim -Mf

08] View a message’s headers:

root@justgeek~]# exim -Mvh [message-id]

09] Check all mails by username

root@justgeek~]# exigrep -u username /var/log/exim_mainlog

10] Below command will display total number of emails send as well receive statistics per domain basis.

root@justgeek~]#exim -bp | exiqsumm | sort -n

11] Delete mails for particular domain which is largest email sender you got by previous step (10).

root@justgeek~]#exiqgrep -i -r domainname.com | xargs exim -Mrm