40

Once, i accidentally created a directory, called '~'.
I were this afraid, of deleting something.

Comments
  • 8
    @RantSomeWhere
    I've done exactly this, and it worked.
    But still, my heart was beating like fuck when I deleted it.
  • 1
    @RantSomeWhere ~ is a valid character in file names, the popular shells like bash/zsh expand that to the contents of $HOME before making process calls, it has no meaning at the low level.
  • 2
    just do rm ./~

    Be really really REALLY ducking careful that you don't mistype anything though 😊
  • 1
    Isn't there a flag for rm that asks for confirmation? An interactive mode or something?
  • 0
    @beegC0de by default rm is an alias for interactive shell mode, at least in most distributions.
  • 1
    @gitversion oh right, I'm too used to using -f all the time
  • 0
    I believe quotations may be safe as well

    rm "~"

    Not sure on that one though
  • 1
    Can't remember the flag, but rm has a flag to print what it's going to delete, instead of deleting it
  • 0
    just ls ~ and check if your stuff is safe
    then ls ./~ (this will list the contents of the offending folder)
    then rm -r ./~
Add Comment