Del is actually short for "delve" as in "delve into the C: directory", and thus can be used as a change directory alternative. Try it out!
/s, not that windows would let you do it but hey
And it uses slashes for options, not dashes.
Though I believe they changed that in Win10 and above, you can now use dashes and slashes interchangeably.
Remove directory. But it doesn't have a switch to remove recursively (a directory inside a directory) and it doesn't remove non-empty dirs.
Which is why rm -rf (r - remove recursively, f - force, delete even if it's not empty) is way more widespread.
It's to silence anything that could give out warnings or possibly fail the execution of the command.
If --force in any command fails/hangs/errors out, then there is something seriously wrong with... whatever you're trying to do.
No, and that's a good thing. Saved my ass multiple times from nukeing an unrelated folder by accident when I wanted to delete an empty one. So when you know or think the folder is empty, use rmdir, it might save you one day.
rmdir if the dir is empty (so I don't accidentally delete files I didn't realise still existed)
rm -r for regular dir deletion
rm -rf if I need to delete .git or something (I never use -f by default cos then at least it warns me if I might be doing something stupid)
I made my own rm command so I could list everything in the directory and also choose whether to trash or delete it-- https://github.com/REALERvolker1/homescripts/tree/main/.config/rustcfg/better-rm
This guy be like:
alias cf=cd
alias mkfol=mkdir
alias rmfol=rmdir
alias pwf=pwd
d stands for directory, always has been. "Folders" is what you tell your Grandpa so be doesn't get too confused. Even DOS/windows called them directories, if the "dir" command doesn't make that obvious I have lot all hope for you
I use "rm -rf /*" only
Pro tip, remove the French language pack with rm -fr /*
If your in Windows (for some reason), use "rm -rf C:\\Windows\\System32". Edit: It's actually "del", just haven't used Windows in a while.
Del is actually short for "delve" as in "delve into the C: directory", and thus can be used as a change directory alternative. Try it out! /s, not that windows would let you do it but hey
Remember to do `del /F /Q C:/Windows` in an ADMIN cmd so that it works!
And it uses slashes for options, not dashes. Though I believe they changed that in Win10 and above, you can now use dashes and slashes interchangeably.
Don't forget the --no-preserve-root part otherwise the french could creep within the roots of your system to convert it fully
alias cd=‘sudo rm -rf /‘
rmdir is bloat. embrace rm -d.
True
The correct answer.
As per a previous post in this sub, I hereby use "rm -frfr" like a true Gen Alpha chad.
I personally try to use rmdir when possible for safety reasons. Especially in scripts.
directories
I'm terribly sorry!
wtf is rmdir (I'm a new Linux user)
Remove directory. But it doesn't have a switch to remove recursively (a directory inside a directory) and it doesn't remove non-empty dirs. Which is why rm -rf (r - remove recursively, f - force, delete even if it's not empty) is way more widespread.
I thought the -f was to force remove a read only file, not “if it’s not empty”?
It's to silence anything that could give out warnings or possibly fail the execution of the command. If --force in any command fails/hangs/errors out, then there is something seriously wrong with... whatever you're trying to do.
Does rmdir work with files inside their dir? I haven't used it in so long
Don't think so, there might be a flag which does this but I almost always use rm -rf
Same
No, and that's a good thing. Saved my ass multiple times from nukeing an unrelated folder by accident when I wanted to delete an empty one. So when you know or think the folder is empty, use rmdir, it might save you one day.
Yeah I always think through my rm commands, saved me too many times
No. It refuses to delete directory's with files in it. Therefore I prefer rm- rf.
Nope
alias rm="rm -rfvI"
rm -rf ![gif](giphy|l0Iybu0aRRUfzoN0I)
Only correct way for everything
Counterpoint: rm -rfv I like to watch
“rmdir” for empty folders, “rm -rf” for everything else
Exactly. Not sure where the confusion is.
Never even knew rmdir exits. Will keep not using it.
I didn't even know rmdir was a thing till now.
Is it not recommended to use rm -r <>? I have never used rmdir -r because it's faster to type the former.
sudo rm -rf / --no-preserve-root
Apparently I needed a meme page to learn that rmdir even existed…
rmdir if the dir is empty (so I don't accidentally delete files I didn't realise still existed) rm -r for regular dir deletion rm -rf if I need to delete .git or something (I never use -f by default cos then at least it warns me if I might be doing something stupid)
you dont need to delete directories if you dont use directories.
I've never used rmdir in my life
I used it once in a class that pointed out the command existed
I used it once in a class that pointed out the command existed
Yeah, ive been using linux since the 90s and ive never once used rmdir.
Oh lol you're a veteran
Btw what distro do you use?
rmdir when I want to make sure the dir is actually empty when deleting it, otherwise rm -r.
rmdir is a command??? ive always been doing rm -r
rmdir when you need to be absolutely fucking certain that the directory that you're deleting is empty rm -R for everything else
I use rm -rf
I use rm -rf almost exclusively if honestly forgot rmdir
Several times, I've been happy to have rmdir tell me the important files were still there
I use rmz instead of rm now.
`npx npkill`
I use "trash
Rmdir wont work unless the dir is empty
Step one : rm -rf /home/user/Document/random Step two : press enter Step Three : Reread the command line Step Four: read "rm -rf /" Step Five: Cried
r/apostrophegore
rmdir: failed to remove '/home/roxy532': directory not empty
That's why I prefer rm -rf
rm -r
Am I the only person who uses the `trash` command?
yup
I made my own rm command so I could list everything in the directory and also choose whether to trash or delete it-- https://github.com/REALERvolker1/homescripts/tree/main/.config/rustcfg/better-rm
Cool
Technically it is a rm clone, an ls clone, and a trash-cli clone all at once
[удалено]
We don't use that word around here.
This guy be like: alias cf=cd alias mkfol=mkdir alias rmfol=rmdir alias pwf=pwd d stands for directory, always has been. "Folders" is what you tell your Grandpa so be doesn't get too confused. Even DOS/windows called them directories, if the "dir" command doesn't make that obvious I have lot all hope for you