Skip to content

mv -f switch highly desired, so as to not overwrite files by default #6747

@webbedspace

Description

@webbedspace

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:file-systemRelated to commands and core nushell behavior around the file systemcategory:enhancementNew feature or requestdeprecated:priority(deprecated: used infrequently) these issues are importantgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions