- [Narrator] Hi and welcome to video of section 3,
Generating Blank Files in Bulk.
In the previous video we've learned
how to make files immutable.
In this video, we'll generate test cases to test
programs that operate on thousands of files.
Touch is a command that can create blank files or
modify the time stamper files if they already exist.
Let's take a look at how to use them.
Let's take a look in to it.
A blank file with the name filename will be
created using the following command.
Generate bulk files with different name patterns
as follows.
In the proceeding code
one to 100 will be expanded as a string, one, two, three,
four, five, six, seven, 100, instead of
one to 100.txt.
We can use various short hand patterns such as
test 1..200.C test
{A..Z.text and so on.
If a file already exists,
the touch command changes all the time stamps
associated with the file to the current time.
However, if we want to specify that only certain stamps
are modified we use the following options.
Touch minus A modifies only the access time.
Touch minus M modifies only the modification time.
Instead of using the current time for the time stamp,
we can specify the time and date with which to stamp
the file as follows, the date stream that is used
with minus D need not always be in the same format.
It would accept any simple date formats.
We can omit time from the string or provide handy
date format such as Jan 2020 10.
Great, in this video we successfully learned
how to generate blank files in bulk.
Hope you enjoyed watching this video.
In my next video we'll learn about finding symbolic
links and their targets.