How do you create a range of files using wildcards?

0164

You can create a range of files using wildcards in the Linux command line by utilizing the touch command along with brace expansion. Here’s an example of how to create multiple files with a specific pattern:

touch file{1..5}.txt

This command will create the following files:

file1.txt
file2.txt
file3.txt
file4.txt
file5.txt

You can also use other patterns. For example, to create files with different extensions:

touch file{1..3}.{txt,csv,jpg}

This will create:

file1.txt
file1.csv
file1.jpg
file2.txt
file2.csv
file2.jpg
file3.txt
file3.csv
file3.jpg

Using brace expansion is a powerful way to create multiple files efficiently.

0 Comments

no data
Be the first to share your comment!