Please be cautious with the rm -rf command

Please be cautious with the rm -rf command.

Attached: why.jpg (415x454, 18K)

rm -rf myLife

# rm -rf

Please be cautious with the power drill when close to your computer.


And keep your dick in the vice.

I keep considering replace rm with a recycler style command rather than a direct and instant deletion.
That is to say, it moves files to a location and deletes them later depending on some criteria rather than right away.
It's pretty rare that I need to instantly reclaim space.

Attached: hi.jpg (693x689, 76K)

It's on my to do list too

Attached: bye.jpg (1280x720, 81K)

I accidentally removed the wrong mounted device when I was drunk and lost all data on my NAS. I love Linux

that's what you get for sinning

Attached: 1502932083441.jpg (640x480, 54K)

What OS / distro are you using?

>tfw rm -rf’d my entire home folder
>have to present project in a couple hours
wtf do I do

If you're an engineer show them a screenshot of `history|tail`. You get 1 free pass where they will warn you about the importance of offsite backups.

rm() {mv "$@" ~/.local/share/Trash}
Should be XDG-compliant I think. Purge it via a systemd timer or your DE's trash clearing functionality.

if you're worried aboot a command damaging your system, well, this is what 'alias' is for...

rm -rf your life

rm -rf / makes your computer go faster

Hey Ave, how's the weather up there in Canada?

rms
safely remove files and directories


I should really set this up

rm -i somefile

Attached: 1511488704757.jpg (600x451, 25K)

and instead of
find ~ -type f -name somefile -exec rm {} \;

try
find ~ -type f -name somefile -ok rm {} \;

will ask for delete confirmation on each match.

just restore it from your backup
you do have one, right?

gvfs-trash folder/
gvfs-ls trash://
gvfs-trash --empty
if you fucked up, gvfs-move trash://folder/ .

or
gio trash folder/
gio list trash://
gio trash --empty
gio move trash://folder .

or fuck
to-trash:
mv "$@" ~/.trash
check-trash:
ls ~/.trash
empty-trash:
rm -rf -I ~/.trash/ && mkdir ~/.trash/
and then just move your shit in/out if you did fuck up
haven't tested this shit, because the gio commands work on my machine, but it should basically look like that

and use those religiously
don't remap rm either, you'll screw up one day and not set up the aliases like a moron on a machine and you'll be fucked
just don't use rm

>empty-trash:
>rm -rf -I ~/.trash/ && mkdir ~/.trash/

Would
rm -rf ~/.trash/*
work?

Attached: ou.gif (359x359, 1.89M)

it would, but it won't remove anything starting with a dot
so, doing
rm -rf .*
will try and hit . and .. (and fail)

you could probably enable dotglob so * matches everything but . and ..

That will overwrite files.

Thanks. And I just tried
alias del="mv -iv $@ $HOME/mnt1/temp/trash"
and
alias del="mv -iv "$@" $HOME/mnt1/temp/trash"
and for some reason when I use it it asks:

$ del The\ Wrestler.avi
overwrite The Wrestler.avi? n
$ mv -iv The\ Wrestler.avi mnt1/temp/trash
The Wrestler.avi -> mnt1/temp/trash/The Wrestler.avi

I'm like "wtf" so I try another file, the file definitely wasn't already in ~/mnt1/temp/trash, same thing:

$ del 187.avi
overwrite 187.avi? n
$ mv -iv 187.avi $HOME/ mnt1/temp/trash
187.avi -> mnt1/temp/trash/187.avi

Any idea what it's doing?

Attached: ram.gif (400x170, 1.91M)

Make it a function.

Based
Based
Ultrabased

I haven't fucked it up yet, I'm going to keep doing it until I regret it

Ok that worked

Attached: doggy.webm (720x404, 777K)

rm -rvf myLife #watch my life flash before my eyes