3 ms·
That's basically what linux `mv` does too. It both moves files to new directories and renames files. mkdir some_dir mv file.txt some_dir # Put file.txt into th
by ianferrel 1y ago
That's basically what linux `mv` does too. It both moves files to new directories and renames files.
mkdir some_dir
mv file.txt some_dir # Put file.txt into the directory
mv other_file.txt new_name.txt # rename other_file.txt to new_name.txt
- do_not_redeem 1y agoLinux's mv does not have this particular failure mode. $ touch a b c $ mv a b c mv: target 'c': Not a directory
- fireattack 1y agoThat's not what OP encountered. The "failure" mode is mv file ../folder where folder is not a folder (non-exist, or is a file). And Linux will happily do this too.
- do_not_redeem 1y ago$ mkdir -p /tmp/x/y/z $ cd /tmp/x/y/z $ touch a b c $ mv a b c ../notexist mv: target '../notexist': No such file or directory
- fireattack 1y agoDo it with one file?
- deleted 1y ago[deleted]
- whilenot-dev 1y ago$ mv a ../notexist $ echo $? 0
- do_not_redeem 1y agoThat's not what OP encountered. > When Gemini executed move * "..\anuraag_xyz project", the wildcard was expanded and each file was individually "moved" (renamed) to anuraag_xyz project within the original directory. > Each subsequent move overwrited the previous one, leaving only the last moved item In a different scenario where there was only one file, the command would have moved only that one file, and no data would have been lost.