how can i change the date of an existing file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how can i change the date of an existing file
# 1  
Old 11-22-2007
how can i change the date of an existing file

Hi,
Plz suggest me how can i change the date of a file.

Suppose my file has been created in some date and i want to give it present date.

How can i do this????
# 2  
Old 11-22-2007
Code:
man touch

eg

touch filename
# 3  
Old 11-22-2007
thanks

thanks porter......
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Change date format in a file.

Hi all, I have a file as below, i would like the change the format of the time from "11/7/2019 20:12" to "2019-07-11 20:12:00" in the last coloumn. any awk solution on this. Input: 2,0,695016,1961612,497212,5800804,0,0,161,33,7605,12226,23,10,66,0,0,34,11/7/2019 20:10... (4 Replies)
Discussion started by: Raghuram717
4 Replies

2. UNIX for Beginners Questions & Answers

How to change existing date to current date in a filename?

Suppose i have a list of files in a directory as mentioned below 1. Shankar_04152019_ny.txt 2. Gopi_shan_03122019_mi.txt 3. Siva_mourya_02242019_nd.txt .. . . . . 1000 . Jiva_surya_02282019_nd.txt query : At one shot i want to modify the above all filenames present in one path with... (4 Replies)
Discussion started by: Shankar455
4 Replies

3. Shell Programming and Scripting

Change date time stamp of existing file

I have a file hello.txt which was created today (today's date timestamp) I wish to change its date timestamp (access, modified, created) to 1 week old i.e one week from now. uname -a SunOS mymac 5.11 11.2 sun4v sparc sun4v Can you please suggest a easy way to do that ? (12 Replies)
Discussion started by: mohtashims
12 Replies

4. Shell Programming and Scripting

Script to change name of a file with date

I have a file that contains todays date(for ex- test_08/30/2013) Now I want a script which will run and change the name of the file and put yesterday's date (for ex- test_08/29/2013) Please help. ---------- Post updated at 04:40 AM ---------- Previous update was at 04:31 AM ---------- I... (2 Replies)
Discussion started by: sv0081493
2 Replies

5. Shell Programming and Scripting

Trying to change header date of a file

Hi, I am trying to write a code for changing header date of a file with a date of 6 month back. Below is the header date on which I am working - 20080531 I want to change it as 20071130 Please suggest me in the way like ,I can change any date in a file with date of 6 months back. ... (9 Replies)
Discussion started by: Monalisa
9 Replies

6. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

7. UNIX for Dummies Questions & Answers

Move A File With Same Date,don't Change The Desitination Dir Date

Assume, I created one file three years back and I like to move the file to some other directory with the old date (Creation date)? Is it possible? Explain? (1 Reply)
Discussion started by: jee.ku2
1 Replies

8. Shell Programming and Scripting

search file, change existing value based on input (awk help)

I have a file (status.file) of the form: valueA 3450 valueB -20 valueC -340 valueD 48 I am tailing a data.file, and need to search and modify a value in status.file...the tail is: tail -f data.file | awk '{ print $3, ($NF - $(NF-1)) }' which will produce lines that look like this: ... (3 Replies)
Discussion started by: nortonloaf
3 Replies

9. UNIX for Dummies Questions & Answers

Inserting Date&Time Stamp In Existing Log File

I am trying to insert a line with a date stamp in a file that is used to monitor activity in one of our directories. By doing this, I want to grep that file each day and go to the last entry for each time a error occurred and pull all errors generated if any exist. If error exists I want that error... (3 Replies)
Discussion started by: shephardfamily
3 Replies

10. Solaris

File Permissions change date

Hi, I was wondering if there is any way to find out when the file/directory's permissions were changed. Typically, when using 'chmod' to change a file/directory's permissions, the modification date does not change. Any help would be greatly appreciated. Thanks. (4 Replies)
Discussion started by: kpatel
4 Replies
Login or Register to Ask a Question