rm -rf issues

We are using the solaris server and if i am using rm -rf to delete the directories its asking the confirmation for each and every file inside the directory.Is there any way to disable ( should not ask the confirmation) only for a particular session?

When the -f option is used, there is no confirmation prompting. Use the real rm command and not an alias or something:

/usr/bin/rm -rf ...
2 Likes

yes double check is its not aliased

just type alias at the prompt ...

regards

Or use:

\rm -rf

to bypass alias definitions

1 Like

If it isn't an alias, which I suspect it is, can you tell us the ownership, the permissions on the parent directory and the O/S version ?

Ive found in the past on various UNIX that if the directory is owned by someone else and there are certain permissions on it (setuid/setgid/sticky bit) then you can be asked about removal of files...UNIX platforms do differ in their implementation of these bits however...

what type of account do you use? besides that if you use root it should not be prompted with that since -f stands for Force. hm.. can you give more details?

should be aliased....check your .profile.you should find something like alias rm='xyz'...where xyz could rm -i or a script you have placed else where.
Are you running as root?

2 Likes

Because there is no reply I guess this is solved and it was an simple forgotten alias?
else check as mentioned for
.profile
or if another person is the admin look for something like
.alias, .ownalias, .*alias*
In companys are often own aliases used in such files wich get updated/loaded automatically.

Best regards and gl.

please check that rm is not aliased, like

Usually it aliased like

rm='rm -i'

please check this to fire the alias command in terminal.

in bash you can check which command is being used:

type rm

In ksh

whence rm

As mentioned, that happens when you have the 'rm' command aliased in the default profile. Typically this is aliased to "rm -i" which will ask for confirmation.

You can avoid that by doing this
# "rm" -rf <dir name>

it will delete everything without asking anything.

HTH

Looks like everyone wants to add more or less redundant replies to that thread which no more deserve the "emergency" label. I wish a mod close it ...

At your service.

-closed-

bakunin

2 Likes