Can I move files with different extensions?

QuestionsQuestions8 SkillsProBasic Files OperationsSep, 17 2025
0139

Yes, you can move files with different extensions using the mv command by specifying each file individually or by using wildcards if they share a common pattern. Here are a couple of methods:

  1. Specifying Each File: You can list each file you want to move, regardless of their extensions. For example:

    mv file1.txt file2.jpg file3.pdf /path/to/destination/
  2. Using Wildcards: If the files share a common pattern in their names, you can use wildcards. For example, to move all files that start with "report" regardless of their extensions:

    mv report* /path/to/destination/
  3. Combining Different Patterns: If you want to move files with specific extensions, you can combine commands. For example:

    mv *.txt *.jpg /path/to/destination/

This command will move all .txt and .jpg files to the specified destination.

0 Comments

no data
Be the first to share your comment!