473,322 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Where 'history' is stored in Bash shell

Colloid Snake
144 100+
Hey everyone-

I'm looking to do a logging project with a user's history. I was hoping to do it in realtime (not rely on the .bash_history which is only updated on logout), but I can't find a good way to do that.

The history command only updates per shell (ie someone using putty to login twice won't update the history with both). So my question is where the history command gets that info, or any ways someone can think of to get that information.

Eventually I'd like to run this as a process in the background and pull info for all users and sessions, but right now I'm just looking for a proof-of-concept for one session.

Any ideas short of digging into the kernel? (That's the "next step" I can think of, and I find that just a wee bit intimidating - probably because I haven't ever tried it - so I'd like to see if there's any easier way.)

~Snake
Dec 16 '07 #1
2 2215
numberwhun
3,509 Expert Mod 2GB
Hey everyone-

I'm looking to do a logging project with a user's history. I was hoping to do it in realtime (not rely on the .bash_history which is only updated on logout), but I can't find a good way to do that.

The history command only updates per shell (ie someone using putty to login twice won't update the history with both). So my question is where the history command gets that info, or any ways someone can think of to get that information.

Eventually I'd like to run this as a process in the background and pull info for all users and sessions, but right now I'm just looking for a proof-of-concept for one session.

Any ideas short of digging into the kernel? (That's the "next step" I can think of, and I find that just a wee bit intimidating - probably because I haven't ever tried it - so I'd like to see if there's any easier way.)

~Snake
I could talk till I am blue in the face about it, but instead, here is a link to the information in the Bash Reference Manual.

Regards,

Jeff
Dec 16 '07 #2
Colloid Snake
144 100+
Dang, I even remember looking through that page too (or maybe just the document), I guess I just completely skipped over that part.

Thanks!
Dec 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: John Bowling | last post by:
I have a java (2.0) program with the following lines: String cmdArray1 = {"lp", "-d", "hp4m", "MyFile"}; System.out.println(Runtime.getRuntime().exec(cmdArray1)); It compliles properly, but...
3
by: William Park | last post by:
I'm very excited to announce shell interface to GTK+2 (2.6.1) for Bash. It read XML syntax describing the widget layout, and returns user selection as shell variable or runs shell command as...
11
by: Magnus Jonneryd | last post by:
Hi, I'm planning on writing a program that interactively is fed input via a shell (bash). I also want to be able to write a shell script that executes various commands related to my program. In...
7
by: chakkaradeepcc | last post by:
HI all, How to execute bash scripts from python (other than using os.popen) and get the values that those bash scripts return. I would be happy if someone could help me out in this.. thanks...
16
by: John Salerno | last post by:
Hi all. I just installed Ubuntu and I'm learning how to use the bash shell. Aside from the normal commands you can use, I was wondering if it's possible to use Python from the terminal instead of...
4
by: arnuld | last post by:
1.) we usually say /return 0/ indicates success e.g #include <iostream> int main() { int i=3; std::cout << i << std::endl; return 0;
1
by: flanker9876 | last post by:
Hello Everyone, I have Windows XP. I hope that someone can assist me with the command prompt. Does anyone know if the commands I enter into the command prompt are automatically saved to a...
1
by: Fredrik Lundh | last post by:
John Lawrence wrote: doesn't exactly work for Python scripts, though: $ cat env.py #!/usr/bin/env python import os os.environ = "hello"
6
by: Frantisek Malina | last post by:
What is the best way to do the regular bash commands in native python? - create directory - create file - make a symlink - copy a file to another directory - move a file - set permissions ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.