Recently I had a script that I needed to run about 100 times in a row. This little one liner came in super handy for that. Replace “COMMAND” with the command that you want to run. In this example, the command will run 100 times in a row!
for i in `seq 100`; do COMMAND; done
“touch” is a handy unix utility to udate the time stamp on a file. Recenly I ran into a case on my mac book pro that required me to update all of the files and sub-directories of a project with the current date.
In terminal, I could have gone one by one an used this command on each file
But after a few moments of onterweb searching, I came across a perfect solution
find . -print0 | xargs -0 touch
This command will find all of the file in all sub-directories, even if they have spaces in their name, and set their last updated time to the current time.
Just a handy tip I thought I would share