Mac – How to use command rm -r in mac terminal

bashmacterminal

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 ?

Best Answer

type -a rm

returns :

rm is aliased to `rm --preserve-root'
rm is /bin/rm

--preserve-root is NOT supported on mac terminal.

Related Question