schoenwolf-schroeder
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Sjmarf to Programmer Humor@programming.devEnglish • 5 days ago

Oh no! 🤦‍♂️

sh.itjust.works

message-square
45
fedilink
1

Oh no! 🤦‍♂️

sh.itjust.works

Sjmarf to Programmer Humor@programming.devEnglish • 5 days ago
message-square
45
fedilink
  • @schnurrito@discuss.tchncs.de
    link
    fedilink
    0•5 days ago

    OK I’ll bite, how do you get rid of a literal ~ directory?

    • @JollyGreen_sasquatch@sh.itjust.works
      link
      fedilink
      0•4 days ago

      A method not yet mentioned is by inode, (I’ve accidentally created filenames I didn’t know how to escape at the time like -- or other command line flags/special characters)

      ls -li

      Once you get the inode

      find . -type f -inum $inode -delete

    • @zarkanian@sh.itjust.works
      link
      fedilink
      0•5 days ago

      Just give rm the entire path or a relative path like ./~

    • Captain Aggravated
      link
      fedilink
      English
      0•5 days ago

      Using Nautilus or Dolphin.

      • @schnurrito@discuss.tchncs.de
        link
        fedilink
        0•4 days ago

        True if these are installed, but if I’m on a server’s command line they probably aren’t.

    • @fin@sh.itjust.works
      link
      fedilink
      0•5 days ago

      rm -rf “~” may work?

      • @ulterno@programming.dev
        link
        fedilink
        English
        0•5 days ago

        In case you are just testing it out, don’t use -rf
        Your ~ directory is most probably empty, so use rm -d instead, to prevent all footguns in case you put the wrong character in the end.

               -d, --dir
                      remove empty directories
        

        I feel safe doing rm -d /.
        I feel safe doing sudo rm -d /.

        Because it won’t delete anything that has a file in it.

      • @petersr@lemmy.world
        link
        fedilink
        0•5 days ago

        No, but single quotes will.

        • @fin@sh.itjust.works
          link
          fedilink
          0•3 days ago

          huh, I almost removed my entire home directory

    • @lengau@midwest.social
      link
      fedilink
      0•5 days ago

      rmdir ./~

    • Raltoid
      link
      fedilink
      English
      0•
      edit-2
      5 days ago

      prefix with path, and/or quotation

    • @barsoap@lemm.ee
      link
      fedilink
      0•5 days ago

      Should be \~ in most shells, certainly bash. Use mkdir and rmdir when messing around to prevent accidents.

      • DacoTaco
        link
        fedilink
        0•5 days ago

        Saw this post this morning and was thinking about how to delete it ( while falling back asleep ). Escaping the ~, ofc that’d work! I feel so stupid now haha

Programmer Humor@programming.dev

!programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
  • 171 users / day
  • 612 users / week
  • 1.52K users / month
  • 3.96K users / 6 months
  • 23.4K subscribers
  • 1.29K Posts
  • 37.1K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne
  • BE: 0.19.3
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org