Scripts must be tested before they are used on a live system. We may need to generate thousands of files to confirm that there are no memory leaks or processes left hanging. This recipe shows how to generate blank files.
Generating blank files in bulk
Getting ready
The touch command creates blank files or modifies the timestamp of existing files.
How to do it...
To generate blank files in bulk, follow these steps:
- Invoking the touch command with a non-existent filename creates an empty file:
$ touch filename
- Generate bulk files with a different name pattern:
for name in {1..100}.txt do...