- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How can I log the command entered
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-17-2000 02:39 PM
11-17-2000 02:39 PM
How can I log the command entered
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2000 03:11 PM
11-17-2000 03:11 PM
Re: How can I log the command entered
Consider using history option in K shell if you just want to log the commands used.
U can use the command "script" to log the enitre session which includes in/out and errors.
Regards,
Pramod
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2000 03:20 PM
11-17-2000 03:20 PM
Re: How can I log the command entered
Add the following in your .profile.
See the attachment.
Ensure your filesystem has long filenames enabled.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2000 03:35 PM
11-17-2000 03:35 PM
Re: How can I log the command entered
http://devresource.hp.com/STK/man/11.00/script_1.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2000 12:15 AM
11-20-2000 12:15 AM
Re: How can I log the command entered
For "logging" all entries and commands from a shell, you could add in your shells lines like this (in ksh):
LOG=/tmp/log.txt
set -xv
exec 1>> $LOG 2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2000 06:19 AM
11-20-2000 06:19 AM
Re: How can I log the command entered
2. You may also use "/usr/sbin/script"
# script -a my_tracefile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2000 06:27 AM
11-20-2000 06:27 AM
Re: How can I log the command entered
In all shells, a history variable set to a number means to record that many commands. The histfile variable controlls where the file is located.
I.E.
BASH and KSH
>HISTORY=1024
>HISTFILE=$HOME/.history
CSH
>set HISTORY=1024
>set HISTFILE=$HOME/.history
For the fancy that want to save commands, use
HISTFILE=$HOME/.history-`date %d-m-%y`.
I agree that though that the script command is probably what you want, however note that the script command is very litteral. All garbage, typo's, etc are there. Be prepared to se ps -ef }^H^H| grep ls ^M, etc.....
Best regards,
Shannon