Creating test files
Last Updated on September 3, 2024 by David Both
Some of my books and articles require you to create some files for testing. This can be done easily from the command line.
- Open a terminal session on your desktop.
- Copy the line below from this post.
- Paste it into the terminal session.
- Press the Enter key.
This Bash program creates 200 files with “Hello world filexxx” in each, where xxx is the file number. You can edit the program and change “200” to any number of files that you need.
for X in `seq -w 200` ; do echo "Hello world file$X" > testfile$X.txt ; done
More Stories
How Immutable Linux Could Save Libraries Thousands
Immutable systems like Silverblue can be configured for kiosk mode in libraries and other public spaces that allow patrons to use them for internet access and other uses but do not allow those patrons to change the core system in any way.
Counting words from online articles
Here’s how I automated counting words from a series of articles.
Introduction to the BtrFS Filesystem
Over the nearly 30 years I have been using Linux, the default filesystem for Red Hat Linux (not RHEL) and...
Quick Tip for umount
Sometimes learning a new thing can be the result of my innate curiosity.
The Truth About Disk Fragmentation
Modern Linux filesystems make defragmentation irrelevant for most of us.