• LeninOnAPrayer@lemm.ee
    link
    fedilink
    English
    arrow-up
    14
    ·
    edit-2
    2か月前

    alias trash-put from trash-cli in both sudo and user.

    myrm() {
      trash-put "$@"
    }
    alias rm="myrm"
    

    This has saved my ass so many times. Especially when typing “rm * .png” instead of “rm *.png”

    Can restore the files using the cli or from system recycling bin.

    The alias to rm is probably not best. So getting use to using another name is probably best. But I’m never had a problem with it.

    • _____@lemm.ee
      link
      fedilink
      English
      arrow-up
      2
      ·
      2か月前

      I’ve never ran into any issues from using rm but I like this idea and will be using it as I only see positives

      • LeninOnAPrayer@lemm.ee
        link
        fedilink
        English
        arrow-up
        3
        ·
        2か月前

        Downsides can be inconsistent behavior. As with any alias it’s not meant to be anything but a replacement in your shell. Scripts/SSH etc.

        Also, you gotta remember to empty your trash. :)

    • pressanykeynow@lemmy.world
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      2か月前

      Or just use snapshots. If you are into aliases make an alias for rm to make a snapshot before deleting something.