History file


 
Thread Tools Search this Thread
Operating Systems HP-UX History file
# 1  
Old 05-15-2012
History file

Hi Experts,

Need your help in understanding the configurations related to history file.


I have few questions regarding this.

(i) Where I can configure the file in which command history would be stored.
On my hp-ux box, for one user history is stored in .history file whereas for other users it is stored in .sh_history file.

(ii) When I execute command

Code:
prod:root# echo ${HISTSIZE}
100
prod:root#

However

Code:
prod:root# wc -l .sh_history
223 .sh_history
prod:root#

I am not able to understand why 223 commands are stored in .sh_history file whereas HISTSIZE env variable is set to 100 only.
Are there any configurations available which will overwrite the HISTSIZE env variable?

(iii)Is there any configs/commands available that will store the timestamp along with the command executed in the history file?
# 2  
Old 05-15-2012
The standard in HP-UX would be e.g
Code:
HISTFILE=$HOME/.sh_history
HISTSIZE=18432
export HISTFILE HISTSIZE

in your .profile
But now you see its just variables, nothing is going to stop you to use something else...
# 3  
Old 05-15-2012
Hi Vbe..

Thanks for the reply.

I checked the .profile file.

Its contents are pasted below.

Code:
prod:root:/# more .profile |grep HIST
export HISTSIZE=100
export HISTFILE=${HOME}/.sh_history
prod:root:/#

HISTSIZE mentioned here is 100 only but still .sh_history file contains more than 200 commands.
# 4  
Old 05-15-2012
The Shell History file is not a text file and is unsuitable for reading with the wc command. All you'll get is a count of the number of line-feed characters it finds.
Also see the manual description for HISTSIZE for whichever Shell you are using. It does not imply that the figure is exact.


The user with a history file called .history is probably running csh rather than the more usual sh or ksh.

Last edited by methyl; 05-15-2012 at 07:48 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

The Great History of UNIX (1969-1999) | 30 Years of UNIX History | YouTube Video

I am pleased to announce this new video in 1080 HD for UNIX lovers honoring thirty years of UNIX history spanning from 1969 to 1999 presented in 150 seconds (two and a half minutes) in 1080 HD, celebrating the 50th anniversary of UNIX. The Great History of UNIX (1969-1999) | 30 Years of UNIX... (8 Replies)
Discussion started by: Neo
8 Replies

2. UNIX for Advanced & Expert Users

Who has modified a file - History?

Hello, I'd want to know who and what time has modified a file in unix (history). I'd like to know all people who has modified a file. Thanks in advance (6 Replies)
Discussion started by: nurinolo
6 Replies

3. UNIX for Dummies Questions & Answers

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (1 Reply)
Discussion started by: sriky86
1 Replies

4. UNIX for Advanced & Expert Users

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (3 Replies)
Discussion started by: linuxadmin
3 Replies

5. UNIX for Dummies Questions & Answers

How to review the history and the commands that has been done in this history?

Hello every body, Kindly inform me How Do i find out the time I executed a command previously on UNIX Solaris?? To be more specific and more clear about what i want to know is that I want a command the enables me to know the history and which command i run at this history/time. FYI I used... (5 Replies)
Discussion started by: ahmedamer12
5 Replies

6. Shell Programming and Scripting

History file copy

Hi Gurus, I have written one profile validating script and it is called from profile file while loading. Now i would like to know how to capture commands executed by user on exit to one file . As to make simple, when i exit from su - oracle ,what all commands are written in .sh_history file... (2 Replies)
Discussion started by: oramnts
2 Replies

7. UNIX for Dummies Questions & Answers

history file

how can we view the commands that are executed in the tty1 being in tty2:confused::confused::confused: is there a way? (6 Replies)
Discussion started by: shaziafathima
6 Replies

8. Shell Programming and Scripting

history of a file

Hi every one, Plz help me, what commands are helpful to know the complete history of a file in unix . like, ls -lrt will give the group & user created & time last accessed. I need to know particularly where that file come from like from which machine it is ftp'ed. Thanks. (1 Reply)
Discussion started by: pradeep_script
1 Replies

9. UNIX for Dummies Questions & Answers

history of a file

Hi, Is it possible to trace out the history of file in unix? iam using HP-Ux11,i have a file modified by some one with the common account.is it possible to get the IP or machine name of the user who modified this?how to trace out this? Thanks for help (2 Replies)
Discussion started by: sudhasudheer
2 Replies

10. Shell Programming and Scripting

File History

Hi all, A small help from u....... i just want to know is there any command to get the history of given file such as file creation date, next modified dates etc... Thank you Chanakya (2 Replies)
Discussion started by: Chanakya.m
2 Replies
Login or Register to Ask a Question