- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- command history
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
07-24-2003 03:20 AM
07-24-2003 03:20 AM
in .sh_history there is a list of the last command type by user.
I wonder if there is a command in HpUx to recall the last command, for example:
>history_command 45
and I want the system reply with the 45th command type by user.
exist this command?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 03:27 AM
07-24-2003 03:27 AM
Re: command history
set -o vi
Then, use the "
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 03:34 AM
07-24-2003 03:34 AM
Re: command history
To setup commandline recall put the following in .profile.
export HISTFILE=$HOME/.sh_history
export HISTSIZE=8192
The HISTSIZE will give a decent amount of history.
Logout and login again (or . .profile).
Press Esc k to bring back the last command. You can also type /
Cheers!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 03:38 AM
07-24-2003 03:38 AM
Re: command history
If you use csh,
the command history will show you the list of command,
ad a !##, where ## is the number of the command,
will execute it again.
!! will execute last command
see man csh
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 04:19 AM
07-24-2003 04:19 AM
Solutionset -o vi
"
"history" #Gives you a numbered list of used commands. You can run any of the commands with "r ##". The ## is the number of the command.
...jcd...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2003 04:49 AM
07-24-2003 04:49 AM
Re: command history
Use ESC k and that will bring the last command. Keep pressing k to go back and j to go forward.
Regards,
Dario
Make sure you have the following in your .profile:
set -o vi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2003 04:35 AM
07-25-2003 04:35 AM
Re: command history
The 45th line in HISTFILE will probably NOT be the 45th command they typed since login. You see that file doesn't track commands based on the login session. It's the list of their commands. In fact if two people are using the same userid, their commmands will both drop into this file.
But what can you do????
cp $HISTFILE $HOME/mylasthistory
Now you have file mylasthistory. You can edit the file to get the line(s) you want.
Another option: the script command. Let's say you are typing in a series of commands and want to log the commands and results.
Run "script mylogfile".
This gives you a new shell with all output going to file mylogfile. When done, exit that shell, then you can edit the file "mylogfile."
(first thing to do when editing it: use :%s/\^v^M//g to remove all control-M's from the end of line. But that's a different story.)
steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2003 05:03 AM
07-25-2003 05:03 AM
Re: command history
# Do some housekeeping & deletie any XtermLogs and hist_ files over 7 days old:
find "$HOME" -name XtermLog\* -xdev -follow -mtime +7 -exec rm {} \;
find "$HOME" -name .hist_\* -xdev -follow -mtime +7 -exec rm {} \;
# Set up unique histfile per session
export HISTFILE=$HOME/.hist_$(tty| awk -F"/" '{print $NF}')
Works fine for me
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2003 05:08 AM
07-25-2003 05:08 AM
Re: command history
First do
set -o vi
Then exec the commands
r
Caesar