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.
It is not stored in a file until written to .bash_history.
Maybe I'm showing my newbie-ness here, but I thought everything in a Linux/Unix system existed as a "file".
Whether it's a file or not, is there any way to directly watch for additions to the recent command history list?
The concept that "everything is a file" might be a bit too broad. In a way it's true: these values are stored in memory, and the entire system memory is accessible as a virtual file in /proc/mem. So I guess you could search through there.
I'm one of several admins on a system which constantly has multiple root login shells open. Occasionally, commands issued by different admins working on similar things will cause unexpected problems which we then have to troubleshoot. This job would be easier if we can see all of the commands that were issued, and the order in which they were issued. It would also be nice - though usually less critical - to be able to retain the command history from a shell that locked up, died, or lost it's connection to the host and wasn't able to add it's recent commands list to the permanent $HISTFILE.
I want to create a command history file that logs commands in from each currently open session "on the fly", so that they appear in the order in which they were issued without having to close out all of the sessions first. The only way I've thought of to do this is to set up a function (something like a 'tail -f') that watches for new additions to each shell's temporary command history and drops them all into a shared file.
(We already have the history file being populated with date/time stamps, courtesy of a suggestion from rjwilmsi on another thread.)
Long ago, I often used lastcomm on SunOS to tabulate command use. On some distributions, this appears to be part of package acct. On one BSD system that I use, however, the accounting is either disabled or normal users cannot use the file:
% lastcomm | less
lastcomm: could not open /var/account/acct: Permission denied
I don't know whether the commands issued are added in real-time.
Still, it might be useful to look into ... cheers, makyo