-
Notifications
You must be signed in to change notification settings - Fork 2.1k
mv -f switch highly desired, so as to not overwrite files by default #6747
Copy link
Copy link
Closed
Labels
A:file-systemRelated to commands and core nushell behavior around the file systemRelated to commands and core nushell behavior around the file systemcategory:enhancementNew feature or requestNew feature or requestdeprecated:priority(deprecated: used infrequently) these issues are important(deprecated: used infrequently) these issues are importantgood first issueGood for newcomersGood for newcomers
Milestone
Description
Related problem
No response
Describe the solution you'd like
Basically, mv in this shell currently seems to act like mv -f in other shells, which seems unusually dangerous for a program intended to be interacted with by humans. Basically, I think the -f (--force) switch should be added to mv for cases of overwriting.
Here's an example of something I was writing that would rename a bunch of images to just sequential numbers. See if you can spot the massive data loss problem that a -f switch would probably have prevented.
ls | sort-by modified | get name | each -n {|e| mv $e.item ($e.index + 1 | into string | $in + '.jpg' )};
Describe alternatives you've considered
No response
Additional context and details
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:file-systemRelated to commands and core nushell behavior around the file systemRelated to commands and core nushell behavior around the file systemcategory:enhancementNew feature or requestNew feature or requestdeprecated:priority(deprecated: used infrequently) these issues are important(deprecated: used infrequently) these issues are importantgood first issueGood for newcomersGood for newcomers