How to create multiple files at once?

QuestionsQuestions8 SkillsProDec, 23 2025
0173

That's a great question! You can create multiple files at once by providing the names as arguments to the touch command, separated by spaces.

Here are a few ways to do it:

1. Specific filenames

If you want to create files with different names, just list them all:

touch file1.txt file2.txt file3.md

2. Numbered or Lettered sequences

If you want to create a series of files (like file1 through file5), you can use brace expansion:

touch file{1..5}.txt

This single command will create file1.txt, file2.txt, file3.txt, file4.txt, and file5.txt.

3. Multiple specific names using braces

You can also use braces for specific names:

touch {apple,banana,cherry}.txt

After running any of these, remember you can use the ls command to verify that all the files were created successfully!

0 Comments

no data
Be the first to share your comment!