There is a lot of documentation about this online, and the bash
man page is really nice.
Even so, I can't understand why this is not working.
Obviously I'm missing something...
I have a directory with 100 files, named file010
, file020
... file1000
.
I want them renamed to new00..99
using mv
(well, mvg
actually, buth both have the same output).
When I run any of the following, I get target 'new99' is not a directory
(always the last).
What am I missing?
id@machine ~/temp/test ls
file010 file090 file160 file240 file320 file400 file480 file560 file640 file720 file800 file880 file960
file020 file100 file170 file250 file330 file410 file490 file570 file650 file730 file810 file890 file970
file030 file1000 file180 file260 file340 file420 file500 file580 file660 file740 file820 file900 file980
file040 file110 file190 file270 file350 file430 file510 file590 file670 file750 file830 file910 file990
file050 file120 file200 file280 file360 file440 file520 file600 file680 file760 file840 file920
file060 file130 file210 file290 file370 file450 file530 file610 file690 file770 file850 file930
file070 file140 file220 file300 file380 file460 file540 file620 file700 file780 file860 file940
file080 file150 file230 file310 file390 file470 file550 file630 file710 file790 file870 file950
id@machine ~/temp/test mv {*,new{00..99}}
/usr/local/bin/mvg: target 'new99' is not a directory
✘ id@machine ~/temp/test mv {file{010..1000..10},new{00..99}}
/usr/local/bin/mvg: target 'new99' is not a directory
✘ id@machine ~/temp/test mv {file*,new{00..99}}
/usr/local/bin/mvg: target 'new99' is not a directory
mv
has to be the directory you're moving to. You're listing the files; it thinks you're telling itnew99
is the directory in which to place all the files, but it can't find that directory.mv
command on your real files that you don't know how it worksmv file1000 new99
there's no complaint.mv
, not just 2. Thanks!