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.

Share:
5,900

Related videos on Youtube

Rmy5
Author by

Rmy5

Updated on September 18, 2022

Comments

  • Rmy5
    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
    Gordon Davisson about 6 years
    --preserve-root is a GNU extension to the rm command, but macOS uses mostly BSD versions of command-line programs (including rm), 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 the man command directly, or use an online copy of the macOS man pages.