News for hackers. Stuff that matters.
Re:Count to ten when a plane goes down by couchand on Tuesday July 22, 2014 @08:55AM (#8068651)
I run into this all the time, too. Now my -rf usage is almost always wrapped by this:

    rmgit()
    {
        git status
        read -p "Are you sure? " -n 1 -r
        echo
        if [[ $REPLY =~ ^[Yy]$ ]]
        then
            rm .git -rf
        fi
    }
Re:Count to ten when a plane goes down by anon4 on Tuesday July 22, 2014 @09:07AM (#8068725)
I think this would be a bit better for interactive cases. Note: written just now, I haven't actually felt the need for this safeguard... yet.

    rmrf()
    {
        (echo "The following files are going to be deleted!!!"
         for FILE in "$@"; do
             echo "<<<" "$FILE" ">>>"
         done) | less
        read -p "Are you sure? " -n 1 -r
        echo
        if [[ $REPLY =~ ^[Yy]$ ]]
        then
            rm -rf "$@"
        fi
    }
Re:Count to ten when a plane goes down by colanderman on Tuesday July 22, 2014 @11:02AM (#8069329)
Doesn't help against network filesystems mounted in subdirectories. --one-file-system (which really ought to be the default) prevents this.