- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to change timestamp of a 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
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
тАО10-20-2008 07:49 PM
тАО10-20-2008 07:49 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2008 08:01 PM
тАО10-20-2008 08:01 PM
Re: How to change timestamp of a file ?
"man touch".
> it is showing 2008 [...]
"Showing" how? At what are you looking?
> [...] i want files to show Oct 2008 to
> show as timestamp .
There's more in a file date-time than the
month and the year.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2008 08:15 PM
тАО10-20-2008 08:15 PM
Solutiontouch -t
==================
-t time Use the specified time instead of the current time.
The option argument is a decimal number of the form:
[[CC]YY]MMDDhhmm[.SS]
Reagrds
Prashant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2008 08:30 PM
тАО10-20-2008 08:30 PM
Re: How to change timestamp of a file ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2008 09:37 PM
тАО10-20-2008 09:37 PM
Re: How to change timestamp of a file ?
This is how you can change the timestamp of a file with touch command, with -t time use the specified time instead of the current time. The option argument is a decimal number of the form: YYMMDDhhmm
$ touch -t YYMMDDhhmm
See this
$ date
Tue Oct 21 11:07:36 IST 2008
$ touch abc
$ ll abc
-rw-r--r-- 1 monitor testing 0 Oct 21 11:07 abc
$ touch -t 0810131020 abc
$ ll abc
-rw-r--r-- 1 monitor testing 0 Oct 13 10:20 abc
$ touch -t 0810130000 abc
$ ll abc
-rw-r--r-- 1 monitor testing 0 Oct 13 00:00 abc
$ touch -t 0710130000 abc
$ ll abc
-rw-r--r-- 1 monitor testing 0 Oct 13 2007 abc
Hope this will solved your problem.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2008 10:21 PM
тАО10-20-2008 10:21 PM
Re: How to change timestamp of a file ?
Oct 20 08:48
but my file for today is only showing as
Oct 21 2008
i.e without the time being shown. So my dba is not able to track when did the dump complete/begin. He is able to track this only after the next day .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2008 10:37 PM
тАО10-20-2008 10:37 PM
Re: How to change timestamp of a file ?
That's correct. Files modified within the last 6 months show the date and time. Otherwise date and year. ls(1) says:
If the time of last modification is greater than six months ago, or any time in the future,
>but my file for today is only showing as Oct 21 2008
This file has a bogus timestamp. This is not within the last 6 months, it is a future time!
>i.e without the time being shown.
There is something wrong with the time on one of your machines, probably using NFS. Or you used touch(1) improperly. You need to do "date -u; date" on each of your machines and make sure they are all in sync.
I'm posting this about: Tue Oct 21 06:35 UTC 2008
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2008 10:59 PM
тАО10-20-2008 10:59 PM
Re: How to change timestamp of a file ?
o/p of date -u;date is
ggnhrdv4: /> date -u; date
Tue Oct 21 01:25:41 UTC 2008
Tue Oct 21 06:55:41 GMT 2008
Do you mean to say that the file in question is being written as of now and once it is completed it will show the time ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2008 12:08 AM
тАО10-21-2008 12:08 AM
Re: How to change timestamp of a file ?
>Tue Oct 21 01:25:41 UTC 2008
>Tue Oct 21 06:55:41 GMT 2008
Your system has the wrong time. You are 5.5 hours slow!
Also, you have an illegal timezone setting.
Your GMT setting looks correct but UTC must also match.
So if you are in India, you must set TZ and /etc/TIMEZONE to IST-5:30
Then if you set your date to local time, your UTC time will match GMT.
What does this show?: echo $TZ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2008 12:22 AM
тАО10-21-2008 12:22 AM
Re: How to change timestamp of a file ?
GMT-5:30
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2008 01:15 AM
тАО10-21-2008 01:15 AM
Re: How to change timestamp of a file ?
This is not a valid timezone, GMT is reserved. Using this just causes confusion. I.e. there is only one GMT timezone and that is "GMT0".
The times for GMT and UTC should always be the same.
So change your timezone to TZ=IST-5:30 and reset your system clock to local time.
Or use "date -u [mmddhhmm[[cc]yy]]" and set to UTC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2009 03:29 AM
тАО01-13-2009 03:29 AM