- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- i want to print one log file with time and date
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
Discussions
Discussions
Forums
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
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
тАО08-25-2011 08:59 PM
тАО08-25-2011 08:59 PM
i want to print one log file with time and date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-26-2011 03:38 AM
тАО08-26-2011 03:38 AM
Re: i want to print one log file with time and date
Is there anything wrong with the simple method of
date > /home/raj/ file
vmstat >> /home/raj/ file
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-26-2011 03:39 AM
тАО08-26-2011 03:39 AM
Re: i want to print one log file with time and date
Or do you want the date stamp in the name of the file?
vmstat > /home/raj/file`date`
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-26-2011 04:21 AM - edited тАО08-26-2011 04:22 AM
тАО08-26-2011 04:21 AM - edited тАО08-26-2011 04:22 AM
Re: I want to print one log file with time and date
>Is there anything wrong with the simple method of
Or even: { date; vmstat; } > /home/raj/ file
>Or do you want the date stamp in the name of the file?
And: vmstat > /home/raj/file$(date)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-26-2011 04:39 AM
тАО08-26-2011 04:39 AM
Re: I want to print one log file with time and date
Hi:
And if you want to tag every line with a date stamp, you could do:
vmstat | while read LINE do echo "$(date '+%m/%d/%Y') ${LINE}" done
...which written on a command line is:
vmstat|while read LINE; do echo "$(date '+%m/%d/%Y') ${LINE}"; done
Regards!
...JRF...