you are viewing a single comment's thread
view the rest of the comments
[–] 54 points 5 months ago* (3 children)

Don't forget the dot files and directories. Use sudo in case of trouble...sudo rm -rf .*

(Don't actually do this, because some shells will take that to include . and .. recursively)

  • source
  • hideshow 6 child comments
  • [–] 38 points 5 months ago (1 child)

    Oh god, I never considered that .* could theoretically match ... Thanks fish for not doing that, more than likely saved my unknowing ass a couple of times

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 5 months ago (1 child)

    Oh god...why would you not just cd .. and rm -r the directory name?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 5 months ago (1 child)

    Because you don't always want to delete the directory itself, to then recreate it and set the ownerships and permissions again

  • source
  • parent
  • hideshow 2 child comments
  • [–] 0 points 5 months ago (1 child)

    Fair enough. Then why not cd .., rm ./dir_name/* ?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 7 points 5 months ago (1 child)

    because that does not delete hidden files in the directory

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 5 months ago (1 child)

    Fair enough. Why not tack on rm ./.* as well to that list? Lol. Sorry, I'm truly just curious and not trying to be a smart alec.

  • source
  • parent
  • hideshow 2 child comments