Tuesday, May 21, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 2387  / 2 Years ago, thu, march 17, 2022, 6:00:11

Warning:

To avoid catastrophic data loss, readers should NOT run this, nor any variations on it!




I would like to understand what does this command do: sudo rm -rf/*


More From » command-line

 Answers
3

As presented, the command will give an error because of a typo.



sudo rm -rf/*
[sudo] password for ___:
rm: invalid option -- '/'
Try 'rm --help' for more information.


Without the typo, the command would attempt to delete all files on the system. It would throw errors for some files, which are inherently undeletable, such as some contained in /proc, /sys, /dev, or read-only file systems.



Although someone else has already indicated in comments how to correct it, I will not do so in this answer because it might cause some newbies to destroy their systems.



For more information about the rm command, see man rm.


[#5331] Friday, March 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nnaisdio

Total Points: 369
Total Questions: 112
Total Answers: 108

Location: Kenya
Member since Mon, Jun 14, 2021
3 Years ago
;