If you run "rpm -ql audit |grep ausearch" it should show you something like:
/sbin/ausearch
/usr/share/man/man5/ausearch-expression.5.gz
/usr/share/man/man8/ausearch.8.gz
The man directories are manual pages for commands. bin = binary on UNIX/Linux (for the most part).
So that tells you the command is in /sbin. You could type the full path to command "/sbin/ausearch" to run it. But if it is something you're using frequently you probably want to add it to your PATH variable. This variable is used to determine what directories to search when you type just the basename of command. Typically it will have things like /bin, /usr/bin, /usr/local/bin, /usr/share/bin and could have other directories not named bin at all. (For example Nagios' NRPE plugin has binaries and scripts in /usr/local/nagios/libexec usually.) The elements are separated by colons. If you type "echo $PATH" it will show you what is currently in your PATH. Presumably "/sbin" is NOT there (assuming ausearch is /sbin/ausearch as it is on my system).
So if echo $PATH shows something like:
/bin:/usr/bin:/usr/local/nagios/libexec
you can add /sbin to it simply by typing:
PATH=$PATH:/sbin
That tells it to reset the PATH variable so it has everything it had before PLUS /sbin.
Note that PATH is typically set on login by things such as /etc/bashrc, /etc/bash_profile, $HOME/.bashrc and $HOME/.bash_profile (assuming you're using bash shell). To make the PATH change permanent (i.e. available each time you login) you'd want to add /sbin to the PATH statement found in one of those files.
Note that some commands are really only intended to be run as root so /sbin often is NOT in the PATH of non-root users but IS in the PATH of the root user. Rather than setting PATH if you're not root you might want to switch to root user (e.g. "su -" or "sudo su -") and check PATH after the switch to see if /sbin is there then run ausearch as that root user.
|