I have a folder full of files that have the same name but different file extensions. For example:
file-1.ai
file-1.svg
file-1.pdf
file-2.ai
file-2.svg
file-2.txt
file-3.ai
file-3.svg
example-1.pdf
example-3.mov
Is there any way in Linux (any programming language will do) I can move the group of files to a new folder (either a new folder per file group or all in one folder) if their file names, minus extension, matches?
Consider this script:
Think you want something like this.
e.g.
There are many ways this can be done. One solution would be to simply use the move command:
mv file-1.* /new/directory
This will move all files named
file-1
regardless of extension to the new directory.