I wanted to recursively move files from a folder (Pictures) to another (Picturesnew).
The "Pictures" Folder had many subfolders and and hence I used this command after following up the posts here.
Both Pictures and Picturesnew were in the same directory. I just wanted to get rid of all the subfolders and combine the data.
I ran the following command from the directory these folders were situated in.
find ./Pictures -type f -name "*.jpg" -print0 |
xargs -0 -Imysongs mv -i mysongs ./Picturesnew
Now seemingly the Picturesnew folder which should have appeared didn't appear at all and hence I am confused as to where 20000 JPG files of mine went.
find ./Pictures -type f -name "*.jpg" -exec mv {} Picturesnew/ \;
? – Nasir Riley Mar 05 '19 at 01:51./Picturesnew
would be treated as a target file name. Butmv -i
should be interactive. Were you asked 20000 times if you want to overwrite? – Mar 05 '19 at 02:13"
characters. Therefore, it should not have executed at all. (2) I believe thatmkdir Picturesnew && mv Pictures/* Picturesnew
would work (would have worked), assuming that you don't have any.
files inPictures
. – G-Man Says 'Reinstate Monica' Mar 05 '19 at 03:02mv -i
got its confirmation from? The stdin is the output fromfind
. The OP should immediately remount that partition read-only and look for forensic tools if they want to recuperate their files, though that's pretty hopeless. – Mar 05 '19 at 14:37