How to fix -rf commands and cp -r in Nethserver

Here is how you can fix forcing coping of files and removal of a mass files forcibly…

Here is what you need to do
cd ~

Now i am going to Warn you right now the moment you remove these safe guards be-careful where you are located before moving files around…

It really sucks to y for a 1000 files of forceful copy so i get it… accidents will happen…
I just made the mistake last night and lost everything trust me!

So here i goes…
cat .bashrc
You will want to put a pound symbol in front of these safe guards to make your machine more usable…

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

Now it should look like this…

# .bashrc

# User specific aliases and functions

#alias rm='rm -i'
#alias cp='cp -i'
#alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

Warning Be careful what directory you are in when you run those commands trust me i changed my entire /var/ folder recursively and forced it to apache trust me be careful…
use pwd to see what directory your in before forcing a command…

You will pull your hair out screaming down the road if you do what i did… I think i called it Baptism by fire only because i couldn’t get anything to work or install last night ok… How to on how to wreck your machine is now over be careful…

I have to fully admit i didn’t ;earn my lesson well thats twice in less than a week i have done something very unfriendly to my main server… I have no business in owning or managing servers lol…

1 Like

I ran into this problem today it really pissed me off trying to remove a bunch of crap… I expect rm -R / to work thats right i wanna be able to delete the whole darn thing when i tell it to!