Skip to content

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

Closed

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

Activity

  1. added
    A:file-system
    on Oct 15, 2022
  2. added a commit that references this issue on Oct 25, 2022
    4e88f87
  3. added a commit that references this issue on Oct 29, 2022
    843d8c2
  4. added this to the v0.71.0 milestone on Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:file-systemcategory:enhancementdeprecated:prioritygood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions