drlacus Posted April 29, 2015 Share Posted April 29, 2015 Hi guys! I have a problem with terminal I would like to solve. I use a program that creates a file like this: "20134abcd.bvec" the name is random, but it starts with "20" every time, because of the date it was originally created is after 2000. I want to incorporate a line into my bash script that renames "20134abcd.bvec" to only "bvecs" without extension. How can I do this as this does not work "mv 20*.bvec bvecs"? Thanks!? Link to comment Share on other sites More sharing options...
ichi Posted April 29, 2015 Share Posted April 29, 2015 If there's only one file, you can do something like this (although "mv 20*.bvec bvecs" does work for me, though): mv $(ls 20*.bvec) bvecs For several files you'd have to iterate through them with a "for i in *.bvec" kind of loop. Link to comment Share on other sites More sharing options...
Stonixx Posted May 18, 2015 Share Posted May 18, 2015 You should be able to use: mv (name and path) (newname and path), and it should rename the file. Link to comment Share on other sites More sharing options...
Recommended Posts