4
Contributors
10
Replies
70
Views
2 Years
Discussion Span
Last Post by Hanif1993
Featured Replies
  • I would say `rm -rf *`. Read More

  • 1
    cereal 1,524   2 Years Ago

    Hi, you can use `rm -rdf *` it will remove all files and directories recursively. For more information about the options read the manual: `man rm` and be careful, always check current path, as it can hurt. Read More

  • These commands remain dangerous even after they've been used, because they remain in your shell history, with a risk of being recalled mistakenly, for example a ^r in a bash terminal may easily recall commands. I wouldn't accept to have a `rm -rdf *` in my shell history. Read More

  • 2

    By erasing them from bash_history, but if you want to delete a folder called "myFolder" and everything in it, just use sudo `rm -rf myFolder` then even if you recall the command later on, it will just give an error that the folder was not found Read More

1

Hi,

you can use rm -rdf * it will remove all files and directories recursively. For more information about the options read the manual: man rm and be careful, always check current path, as it can hurt.

0

Yes, just replace * with the path, for example:

rm -rdf /tmp/something/

I suggest you to read the manual, it explains all the available options and there are also few examples.

1

These commands remain dangerous even after they've been used, because they remain in your shell history, with a risk of being recalled mistakenly, for example a ^r in a bash terminal may easily recall commands. I wouldn't accept to have a rm -rdf * in my shell history.

Edited by Gribouillis

Votes + Comments
+1
2

By erasing them from bash_history, but if you want to delete a folder called "myFolder" and everything in it, just use sudo rm -rf myFolder then even if you recall the command later on, it will just give an error that the folder was not found

Votes + Comments
Thanks!
0

On my system, I installed the hh command from Click Here (shell history suggest box). I can navigate history with the hh command and remove specific entries with the del key.

Another way is to clear the whole history with commands such as cat /dev/null > ~/.bash_history && history -c && exit, but check that the history does not come back after rebooting.

Edited by Gribouillis

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.