What difference does the backslash make in the below syntax to remove a UNIX directory having contents?

StackOverflow https://stackoverflow.com/questions/13976037

Domanda

I need to delete a directory that contains several sub-directories and files. After googling and looking at the man pages of rmdir and rm, I have these two alternatives:

$ rm -rf <folder_name> and $ \rm -rf <folder_name>

How do these two differ?

È stato utile?

Soluzione

Using \ implies that you want your shell to ignore any aliases based on this command

Let's say you have an alias like this one:

alias rm='rm -i'

You would very much like to ignore it if you want to rm your whole /.

Good luck

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top