- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- enable History file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 10:51 PM
11-18-2003 10:51 PM
Someone knows like qualifying history file on a shell sh?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 10:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 10:55 PM
11-18-2003 10:55 PM
Re: enable History file
See
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=59366
Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 10:56 PM
11-18-2003 10:56 PM
Re: enable History file
-Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 11:00 PM
11-18-2003 11:00 PM
Re: enable History file
HISTFILE=${HOME}/.history_files/.hist.`who am i|awk '{print $1}'`.$$.`date +%d%m%y.%H%M`
HISTSIZE=1000
in our .profile so we get a unique history file for each user by date for auditing purposes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2003 11:35 PM
11-18-2003 11:35 PM
Re: enable History file
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 12:04 AM
11-19-2003 12:04 AM
Re: enable History file
To enable the history file, the env variable HISTFILE (and optionally HISTSIZE) must be set at login. This is best done in /etc/profile for 'normal' logins.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 12:18 AM
11-19-2003 12:18 AM
Re: enable History file
Thanks,
Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 01:00 AM
11-19-2003 01:00 AM
Re: enable History file
In root's .profile, add:
# Set up logging
HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`
date >>$HISTFILE
export HISTFILE
HISTSIZE=500
export HISTSIZE
This creates a seperate .sh_history file for each admin - for example, mine is:
.sh_history_gwild
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 01:39 AM
11-19-2003 01:39 AM
Re: enable History file
es:fc -l
134 pwd
135 ls
136 ll
for recall the ls command?
!ls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 01:42 AM
11-19-2003 01:42 AM
Re: enable History file
if it is C-shell, try the exclamation mark followed by the command number, e.g.:
# !135
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 01:48 AM
11-19-2003 01:48 AM
Re: enable History file
eg: EDITOR=vi
You can then use ESC followed by - to move back through your history, and ESC + to move forwards.
Alternatively, you can run the shell with options
eg:
ksh -o vi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 01:50 AM
11-19-2003 01:50 AM
Re: enable History file
add:
set -o vi
To your .profile
Then,
esc k
To recall history, keep prssing k to go back...or, better yet, because it is vi, use / to search - ie:
esc k
/ls
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 01:53 AM
11-19-2003 01:53 AM
Re: enable History file
es:fc -l
134 pwd
135 ls
136 ll
Try with:
# r 135
HTH
Kind regards,
Zigor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 01:57 AM
11-19-2003 01:57 AM
Re: enable History file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2003 02:00 AM
11-19-2003 02:00 AM
Re: enable History file
Instead of "fc -l", press escape, and then "k", or "-" to scroll back through your commands, editing and resubmitting.
Refer to the Command Re-entry section of "man ksh"
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2003 01:20 PM
11-20-2003 01:20 PM
Re: enable History file
export EDITOR=/usr/bion/vi
Then ESC k will recall the last command. ESC / will allow a search as in: ESC /abc which recalls the last command with abc in it. The man page for the POSIX shell is man sh-posix but the command recall feature is identical in ksh. A nice alias in the POSIX shells (sh and ksh) is history (an exported alias for fc -l)
Bill Hassell, sysadmin