I got a bunch of files in some directory (along with many other files) that I want to move.
Luckily, all the files I want to move contain a certain identifier in their names, so I can ls | grep IDENTIFIER
to get the exact list of files to move.
But, how can I execute mv file /path/to/dest/folder/
at once, and not one by one (there's a lot of files to move)?
mv file1 file2 ... destination
– Jonathan H Jul 23 '17 at 15:29ls
. – dessert Dec 01 '17 at 09:42man mv
, this now makes sense!:mv [OPTION]... -t DIRECTORY SOURCE...
One target dir; multiple sources--hence the...
afterSOURCE
. – Gabriel Staples May 03 '22 at 23:29mv a b -t dir
on Apple OS you getmv: rename -t to dir/-t: No such file or directory
but it works;) – Timo Feb 01 '24 at 16:13