I've got a bunch of files all named like this:name_file-1.txtname_file-2.txtname_file-3.txtsome_other_file-1.txtsome_other_file-2.txtThere are thousands of different filenames, some with just one -1.txt at the end, some with -1.txt, -2.txt ... -60.txtI need to copy the highest numbers of each file, so name_file-3.txt, some_other_file-2.txt. How do I do that on a Linux command line?
Sort files by highest number in filename
shell script;files