- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- System Administration
- >
- Re: I want to print one log file with time and dat...
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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...
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP