touch is a command line utility to change file timesteps

learn more… | top users | synonyms

2
votes
3answers
142 views

How to create multiple files with different names and different extensions?

I'm trying to create some files that has different names and with different extensions. Let say I want to create for example 3 files with following name and extension: File001.000 File002.001 ...
-3
votes
0answers
23 views

Touch -am command [on hold]

I am not getting the proper output by using the following command touch -am filename. Anyone help me to understand the concept. Have created 3 files, and also modified one of the files.
2
votes
2answers
90 views

How to disallow file modification time change for non root users

I don't want anybody to create a file then change the creation date to backward date(For example using touch or system call). In my Ubuntu hosting account I'm getting many hacked php code getting ...
1
vote
2answers
80 views

How to get proper format from date for the touch -A argument?

I would like to change all of the attribute times of some files to the immediate date. It appears that I would need to use touch -A * (more or less; realizing that I am going to use a more complex ...
1
vote
3answers
87 views

shell script for auto-touching files

I have written a shell script to touch all the files in the /tmp directory. However, there was an error message saying that /bin/touch: Argument list too long. What's the cause of the problem? ...
3
votes
4answers
265 views

Make many subdirectories at once

Suppose I have a directory /, and it contains many directories /mydir, /hisdir, /herdir, and each of those need to have a similar structure. For each directory in /, there needs to be a directory doc ...
1
vote
3answers
161 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 ...
2
votes
1answer
124 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
49 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 ...
4
votes
3answers
3k 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
368 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
69 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 ...
68
votes
15answers
12k 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 ...
1
vote
3answers
3k 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 ...
9
votes
3answers
7k 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
6k 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
7k 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: ...