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


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Move A File With Same Date,don't Change The Desitination Dir Date
# 1  
Old 01-09-2008
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?
# 2  
Old 01-09-2008
The mv command does not change the mtime of the file, which is the default display. the filetimes: mtime, atime: can be reset to any time you want with the touch command.
Code:
touch -t 200701010000 filename

sets filename's mtime to be Jan 1, 2007 at midnight.

The ctime is NOT a creation time, there is no such thing in unix. It is the time some of the files inode metadata - like ownership or protection mask -- were changed.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

File Move based on date

how to move file based on date in linux (1 Reply)
Discussion started by: syedzoniac
1 Replies

3. Shell Programming and Scripting

Save all the file of current date in another dir?

Hi i want to copy all the files of current date in another directory. for example, below i want to save all the file of 26 march to copied in debug dir. $ ls -lrt | tail -5 -rwxrwxrwx 1 khare guest 73 Jan 6 12:35 chk -rw-r--r-- 1 khare guest 770 Mar 26 02:21 cc1... (2 Replies)
Discussion started by: scriptor
2 Replies

4. UNIX for Dummies Questions & Answers

Move Multiple Files adding date timestamp before file type

There are files in a directory and I have to move multiple files adding datetimestamp before the file type. /Data/ abc.csv def.csv ghi.csv I have to move this files to archive directory adding datatimestamp before .csv /archive/ abc_YYYYMMDDHHMMSS.csv def_YYYYMMDDHHMMSS.csv... (7 Replies)
Discussion started by: eskay
7 Replies

5. Shell Programming and Scripting

Find file that matches today's date in filename and move to /tmp in bash

I'm having problems with my bash script. I would like to find a file matching today's date in the filename, i.e. my_file_20120902.txt and then move it to a different directory, i.e. /tmp. Thanks. (1 Reply)
Discussion started by: jamesi
1 Replies

6. Shell Programming and Scripting

Move File Every Last Date of the Month

Dear experts, I have a file named "GI_GR.csv" generated by SAP everyday. What I need is every last date of the month ( Jan 31, Feb 28/29, Mar 31, etc), the file is copied to subfolder named "archive" and rename it to "GI_GR_Jan.csv" for January and so on. What I want to ask is, how to check if... (8 Replies)
Discussion started by: kris.adrianto
8 Replies

7. UNIX for Dummies Questions & Answers

Move txt file to with current date appended to filename

I have multiple txt files which begin with the word "orders" in folder C:\source. I need to move the files to folder C:\dest and rename them to "process_<date>_<count>" So for example , if there are 3 files ordersa.txt , ordersb.txt and ordersc.txt in C:\source , after running the script I want... (7 Replies)
Discussion started by: johannd
7 Replies

8. Shell Programming and Scripting

Move txt file to with current date appended to filename

I have multiple txt files which begin with the word "orders" in folder C:\source. I need to move the files to folder C:\dest and rename them to "process_<date>_<count>" So for example , if there are 3 files ordersa.txt , ordersb.txt and ordersc.txt in C:\source , after running the script I want... (1 Reply)
Discussion started by: johannd
1 Replies

9. Shell Programming and Scripting

Move file older date

hlow all i have folder with name like this 20110512 20110601 20110602 so i want move the last 1 day to other directory for example this date 20110602 so i want move folder older 1 day from this date 20110512 -----> this folder will move to other dir 20110601-----> this folder will move... (2 Replies)
Discussion started by: zvtral
2 Replies

10. Shell Programming and Scripting

Loop through files in dir, omit file with latest date

I want to loop through files in a directory but omit the file with the latest date in my list of files. How would I accomplish this? Thanks (2 Replies)
Discussion started by: stringzz
2 Replies
Login or Register to Ask a Question