I have a task which contain a series of manual steps. One of the steps is to execute rm -rf *
. Everything in the folder does need to be deleted but this seems a little dangerous for example. if the user is not paying attention and is in the wrong folder when they run the command.
Is there any safe way to preform the task of removing everything in the folder?
rm -rf /full/path/to/dir/*
-- I must confess this bit me once: had to restore the server from tape backup. – glenn jackman Apr 30 '19 at 12:55rm -rf *
report an error by implementing a shell function that serves as the alternative to it. The code is available at CodeReview SE if you are really interested (I bet you aren't) – Weijun Zhou Apr 30 '19 at 13:43-i
flag or creating an alias; e.g.alias rm='rm -i'
. – ILMostro_7 Apr 30 '19 at 15:41