How to use command rm -r in mac terminal?
5,900
type -a rm
returns :
rm is aliased to `rm --preserve-root'
rm is /bin/rm
--preserve-root is NOT supported on mac terminal.
Related videos on Youtube
Author by
Rmy5
Updated on September 18, 2022Comments
-
Rmy5 over 1 year
I'm just trying to delete a non empty folder (and sub contents) with the terminal on mac (folder is a non system folder, just a random testing folder placed on user desktop):
rm -r foldername
It returns:
rm: illegal option -- - usage: rm [-f | -i] [-dPRrvW] file ...
unlink file
Does anyone know the right way to go about this ?
-
Gordon Davisson about 6 years
--preserve-root
is a GNU extension to therm
command, but macOS uses mostly BSD versions of command-line programs (includingrm
), so it doesn't support that. If you try to bring things directly over from linux to macOS, there are a lot of such differences you may run into. Also, don't consult the linux man pages when using macOS -- either use theman
command directly, or use an online copy of the macOS man pages.