• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

query about histoy command

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello sir,
suppose we like to store history of user in file. is there any possibility to do this using shell script and also shell script to store multiple uers history at a time using shell script
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What history are you talking about? bash already stores command history, I think that the number of commands remembered is configurable.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. The history of commands executed for the users will be stored in the .bash_history file inside the home directory. Also the number of commands to be stored in history can be configured using the H!ISTSIZE property. Some additional useful commands can be found on http://www.unixonthego.com/history-command-with-unix/ website.
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello dhoruboyina manjunath,

Welcome to CodeRanch!

As above posts mention, command history is already store in shell's history file (e.g. ~/.bash_history in case of bash).

Also, since this file is in home directory, there will be separate history file per user.

I hope this helps.
 
reply
    Bookmark Topic Watch Topic
  • New Topic