HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- modify date-time of a file
Operating System - HP-UX
1834252
Members
2212
Online
110066
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-07-2003 05:42 PM
08-07-2003 05:42 PM
modify date-time of a file
Hi,
Is there any way to modify the date-time of a existed file.
As I know, use "touch" you can do:
1. if the file is not existed, then system will create the file with 0 byte
2. if the file is existed, system will update the file's date-time to the current.
My question is if I wanna modify the date-time to 1 day before???
Is there any way to modify the date-time of a existed file.
As I know, use "touch
1. if the file is not existed, then system will create the file with 0 byte
2. if the file is existed, system will update the file's date-time to the current.
My question is if I wanna modify the date-time to 1 day before???
Donald
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2003 05:46 PM
08-07-2003 05:46 PM
Re: modify date-time of a file
use the -t switch of the touch command
-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]
The following command sets the modification and access times of the file named "bastille" to midnight, July 14, 1989, creating the file if it does not already exist.
touch -t 8907140000 bastille
-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]
The following command sets the modification and access times of the file named "bastille" to midnight, July 14, 1989, creating the file if it does not already exist.
touch -t 8907140000 bastille
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2003 06:02 PM
08-07-2003 06:02 PM
Re: modify date-time of a file
I remember there is a thread on this, find answers here:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x8669ef70e827d711abdc0090277a778c,00.html
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x8669ef70e827d711abdc0090277a778c,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2003 06:17 PM
08-07-2003 06:17 PM
Re: modify date-time of a file
Add to above, 'touch -t' can only modify the last-access and modification timestamp(that is normally shown). You cannot modify the last i-node change time(change of permission), using the following command to show a file's last i-node change time:
# ls -cl
# ls -cl
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP