Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-19-2012, 09:24 PM   #1
LQ Newbie
Registered: Apr 2012
Posts: 1

Rep: Reputation: Disabled
Command not found ausearch

Hi I am trying to do an audit but am unable to use the ausearch command. I have updated and installed audit using yum but still cannot get anything. Also I am using CentOS 5.5

Thanks if you can help
Old 04-20-2012, 08:46 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,075
Blog Entries: 14

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
If you run "rpm -ql audit |grep ausearch" it should show you something like:

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:
you can add /sbin to it simply by typing:
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Extracting auditing info using awk system and ausearch BlackCrowe Programming 6 09-02-2010 02:51 AM
setup command not found in Ubuntu 10.04 Command Prompt vinaytp Ubuntu 2 05-06-2010 02:10 PM
Shell: command not found / Runs fine with "Run command" badbunny Linux - Newbie 1 01-22-2007 02:21 AM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-28-2006 12:57 AM
bash: <command name> command not found smash Programming 5 03-13-2006 09:48 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration