Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Solaris. I have several directories with the following names:

I want to remove these directories along with its content, so I use:

rm -fr saa*

What I get is the following questions:

rm: examine files in directory (yes/no)? n
rm: examine files in directory (yes/no)? n
rm: examine files in directory (yes/no)? n

I don't get any error, but the directories are not deleted. What gives?

Here is my Solaris info:

$ cat /etc/release
                  Solaris 10 10/08 s10s_u6wos_07b SPARC
       Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
                    Use is subject to license terms.
                        Assembled 27 October 2008


It works after I use the following command:

/usr/xpg4/bin/rm -fr saa*

I am still interested with the explanation why it didn't work with /usr/bin/rm though.

share|improve this question
up vote 8 down vote accepted

You will most likely find that you have rm aliased to rm -i. If you had answered y to the question you would then have been asked to authorise the deletion of each file in each directory.

$ alias rm
alias rm='rm -i'

$ rm -r tmp1
rm: examine files in directory tmp1 (yes/no) y
rm: remove tmp1/1 (yes/no) y
rm: remove tmp1/2 (yes/no) y
rm: remove tmp1: (yes/no) y

You can temporarily remove the alias with the unalias command. If you want to permanently remove it you will have to find where in your shell initialisation files it is defined and remove it. Had you used the full path /usr/bin/rm it would have worked the same as /usr/xpg4/bin/rm

share|improve this answer
You are right, there is an alias to rm -i as you predicted. Who the bloody fool did this to me?.. I wasted 1 hour for this. – Rosdi Jan 18 '11 at 10:45
\rm would also work to override the alias. Note to future readers: It's a bad idea to alias rm to rm -i. If you get in the habit of relying on this it will bite you hard one of these days when you assume that the safety net is there and it's not. – Dennis Williamson Jan 18 '11 at 15:03

I reckon this is due to files not being removed from those directories, henceforth the directories can't be deleted.

A more controlling way of doing this would be the following

find . -name "saa*" -maxdepth 1 -exec rm {} \;
find . -name "saa*" -maxdepth 1 -exec rmdir {} \;

This will make sure that it deletes files from those directories first, and then once the directories are empty it'll remove the directories themselves.

share|improve this answer

Isn't there a -d option on Solaris? On BSD, I would 'rm -dfr directory'. Check your man page :-)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.