Questions tagged [touch-command]

The GNU touch tool, part of coreutils, is used to create files or update their access records

7 questions
103
votes
3 answers

How to `touch` files recursively?

I need to change the timestamp of about 5000 files. Typing touch file1.txt, touch file2.txt will take me forever. Is there a way to do something in the lines of touch -R *?
10
votes
4 answers

Linux Touch Directory Command

What does the command 'touch' when applied to a directory? $ mkdir test $ ls -l test drwxrwxr-x 2 dragos dragos 4096 Oct 27 18:08 test $ touch test $ ls -l drwxrwxr-x 2 dragos dragos 4096 Oct 27 18:08 test
5
votes
2 answers

How to compute date for touch -t

How to create date type in bash? what this date mean? '1803141400' touch -t 1803141400 test1 test2 How can I compute time?
Person.Junkie
  • 185
  • 1
  • 5
2
votes
1 answer

WSL: command work manually but not in cron

This command work manually in WSL Ubuntu but not in cron. Manually it is: touch /var/www/html/myFile.sh By cron every minute it is: * * * * * touch /var/www/html/myFile.sh Why it's not effective when in cron?
1
vote
3 answers

How do I change the Creation/Mod Date of all folders on a USB drive using Touch command?

I've got a USB drive with mp3 music on it that I play in my car. My car has a USB drive port. Problem is that the car sorts the music by Creation/Modification Date (and not alphabetically). This makes it a pain to find what artist I'm looking…
Chad--24216
  • 1,231
1
vote
1 answer

Touch files from a list of files

I often touch up files so they show up at the top of the file manager. Is there a way to touch a list of files instead of touching each one individually? touch test1 test2 is not what I am looking for. Piping ... So the output of a list of files…
fixit7
  • 3,399
0
votes
1 answer

touch: invalid option -- 'B'

I came across touch's option -B from this resource. According to the resource, by using the -B option of touch alongside reference (-r) option we can achieve the following: The -B option modifies the timestamps by going back the specified number…
Chiranga Alwis
  • 113
  • 1
  • 8