touch is a command line utility to change file timesteps

learn more… | top users | synonyms

1
vote
3answers
38 views

How do I set a file's mtime in epoch format?

I know how to get a file's mtime in epoch format: stat --format=%Y <file> But I have not been able to figure out how to set a file's mtime in epoch format. The touch(1) man page appears to ...
1
vote
1answer
33 views

Set file creation date to its modification date on OSX

I need to batch edit file creation date (some stupid audio recorder set the file creation date to UNIX epoch and the correct recording date in the modification date) to set it to the files ...
0
votes
2answers
31 views

clone create date [duplicate]

I would like to clone only the create date and the filenames in source and destination are different. The name part of it is the same, it's the extension that isn't. AVI videos in one directory, MP4 ...
3
votes
3answers
487 views

Efficient way to create multiple files

I have been testing find directory which is taking max inodes and while testing I had run touch test_{1..1391803}.txt But it's give me error "-bash: /usr/bin/touch: Argument list too long", now ...
0
votes
1answer
111 views

Updating last modified time of a file

I have created a script to read 15 pcap files from a folder and merge then into one file using mergecap command. I want the merged file to have the creation time same as the first file of the 15 files ...
1
vote
0answers
56 views

Changing file time using touch

Im trying to change the file time of a m#merge the files to a temporary file. mergecap -w "${dir_dcn}"/merge_dcn.pcap "${FILES_dcn[@]}" touch -r "${FILES_dcn[14]}" dcn_file ls -l dcn_file ...
67
votes
15answers
11k views

What are the legitimate uses of the `touch` command?

What's the point of the touch command? I know I can create empty files with it, but so is also the case with echo -n. Otherwise, why would someone need to change the timestamps of a file? Unless to ...
2
votes
3answers
2k views

touch: cannot touch file: No such file or directory

I am getting the error: touch: cannot touch `/opt/tsrm/compliance/cme/log/20121207.log`: No such file or directory on the touch command: touch $LOGFILE I also checked the link: touch: cannot ...
8
votes
3answers
6k views

touch all folders in a directory

I am trying to update the timestamps of all folders in the cwd using this: for file in `ls`; do touch $file; done But it doesn't seem to work. Any ideas why?
10
votes
1answer
5k views

touch: cannot touch `foo': No such file or directory

What could cause touch to fail with this error message? touch: cannot touch `foo': No such file or directory Note that an error due to incorrect permissions looks different: touch: cannot touch ...
7
votes
3answers
6k views

How do I change folder timestamps recursively to the newest file?

I was wondering if anyone knows how to change the timestamps of folders recursively based on the latest timestamp found of the files in that folder. So for example: ...