Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I occasionally run into a situation where I need to know more details about the command history than just the list of commands generated by the Bash history command.
Is there a (relatively simple) way to generate a more inclusive log file which works as follows:
1) Logs all commands issued by root,
2) Logs commands from multiple terminal windows simultaneously and to a single file,
3) Logs the commands in real time, in the order they were issued, and
4) Puts a date/time stamp on each command
That may be a lot to ask, but what I'm describing seems like a feature/function that a lot of system admins might find useful. Does a tool like this exist somewhere already?
Another related question:
Is there a setting that can be "switched on" which will include commands run from within Bash shell scripts in your Bash history file?
The only purpose to this is to help me find out exactly what happened in my server; primarily by seeing how commands issued by different administrators from different terminals might have interacted, especially if they were working on closely related parts in the system.
If it's important to include this, I'm running Fedora Core 6 & 7 and Red Hat Enterprise 4 & 5.
(or another accepted time format) to your .bashrc file to get a timestamp on all commands - note the trailing space included in quotes.
That's a good start!
Now, would there be a good way to snag new entries from the temporary history file (that each command shell keeps until it's closed) and drop them into a permanent file? As far as that goes, where is the temporary history file? And what's it's filename?
Originally Posted by chrism01
Also, the sudo util can log both successful and failed attempts, which may be useful.
I don't understand here. Successful & failed attempts to do what? Enter a command?