How to create files with different extensions?

069

You can create files with different extensions using the touch command by specifying the desired file names along with their extensions.

Example:

To create files with different extensions like .txt, .jpg, and .pdf, you can use:

touch file1.txt file2.jpg file3.pdf

Using Pattern Expansion:

You can also use brace expansion for a more concise approach:

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

This command creates:

  • file1.txt
  • file1.jpg
  • file1.pdf
  • file2.txt
  • file2.jpg
  • file2.pdf
  • file3.txt
  • file3.jpg
  • file3.pdf

If you need more help or examples, just let me know!

0 Comments

no data
Be the first to share your comment!