rm -rf not able deletes file but not the directory


 
Thread Tools Search this Thread
Operating Systems Solaris rm -rf not able deletes file but not the directory
# 8  
Old 12-11-2011
i created a test directory and created few more dir with it and few files with those created directories..

and when ran rm -rf testdir it removed all files present with the it .. but the sub dir where still present and the same error is thrown
# 9  
Old 12-11-2011
This User Gave Thanks to dude2cool For This Post:
# 10  
Old 12-11-2011
well my mount point has 770 permission and i logged in as the owner of the mount point and tried rm -rf dir it throwed the same error

and also to be noted.. rm -rf works for file but not for dir.

and when i execute rm -rf directory it removes all files under that dir but leaves the sub directories .. it doesnt remove dir.. but removes files..


later i tried to by coming out of that mount point.. and then gave the ful path of the dir to be deleted then.. i could remove it..

would be nice if someone has some explanation for this
# 11  
Old 12-11-2011
That's strange. Could really use some details about the environment you're doing this on though..

What filesystem type is it that you see this behavior on?

Does it behave that way in other parts of the system or with other users, or just in the directory structure which you're working, or as a particular user?

Is the filesystem local or remote?

What OS/Vers?
# 12  
Old 12-11-2011
solaris 10 .. OS is installed with zfs file system.

but the mount points are vxfs . the issue is with 4 new mount points that are created with 770 permissions..

it works fine for root user.. but for other users including the mount point owner has the issue.

files are removable but not directory.. and to be noted.. an empty dir can which doesnt have any sub directory in it can be removed but if the dir contains some sub dir it cannot be removed.

its a local file system only
# 13  
Old 12-11-2011
This thread has a lot of good info on that:

<ack, I can't post urls yet>

Just do this google search and it's the top link: probably rm rf solaris

I wonder if the umask in your /etc/profile is something more restrictive than default? It would be interesting to log in the owner, open up his umask, move the directory, move it back, then run the rm -rf command again.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

A system deletes my .bashrc file

It deletes my .bashrc file rarely but predictability after some unknown count of Mac's restarts. Has someone ever faced such behavior? How do I prevent OS X from modifying .bashrc? What ownership/permission should I set up to not let it happen? OS X Lion. (6 Replies)
Discussion started by: scrutinizerix
6 Replies

2. UNIX for Dummies Questions & Answers

Command rm deletes filename but not the blocks

Hi It happens when I try to delete a file of 250MB with the command rm -r on our old Intergraph CLIX that the filename disappears while the blocks remain on the machine. Only when I reboot the system the blocks really disappear. Then rm works again for sometime but after some time it happens... (15 Replies)
Discussion started by: hausi2012
15 Replies

3. Slackware

Thunderbird 3.1.9 deletes from drafts

I am using Tbird as it came with Slackware 13.37 and everytime I send something I get a message 1 or 2 drafts deleted. Should it be doing that? If not has this been reported ? How can I find out if it was reported? I have no drafts to delete. (2 Replies)
Discussion started by: slak0
2 Replies

4. Shell Programming and Scripting

Why sed command deletes last line in a file if no carriage return?

Hi I am using sed command to make SCORE=somevalue to SCORE=blank in a file. Please see the attached lastline.txt file. After executing the below command on the file, it removes the last line. cat lastline.txt | sed 's/SCORE=.*$/SCORE=/g' > newfile.txt Why does sed command remove the... (3 Replies)
Discussion started by: ashok.k
3 Replies

5. UNIX for Advanced & Expert Users

MAKE-like build that deletes orphans?

I have a complex multi-stage (media conversion and formatting) build process that leaves orphan target files needing deleting automatically (i.e. by reference only to the build rules themselves, not any parallel config) upon each regular build. Since MAKE cannot do this, what can? Thanks. (4 Replies)
Discussion started by: chrisjj
4 Replies

6. Shell Programming and Scripting

A script that deletes files.

I want to write a script that deletes files inside the dir. However, the script should also allow the user to confirm by pressing (d) key before deleting files.. #!/bin/bash for file in $1/* do size='ls -l $file | cut -f 5 -d " "' name='ls -l $file | cut -f 9 -d " "' ... (1 Reply)
Discussion started by: herberwz
1 Replies

7. UNIX for Dummies Questions & Answers

Deletes those files in a directory ?

I need a shell script that accepts 2 directories names bar1 and bar2 as arguments , and deletes those files in bar2 which are are identical to their name spaces in bar1. I tried with this code but it gives error. if then echo " syntax <comnd dir1 dir2 > " exit else ... (6 Replies)
Discussion started by: krishnampkkm
6 Replies

8. UNIX for Advanced & Expert Users

rsync deletes original directory

Hi I have a strange problem. Sometimes when I execute the below command something wierd happens. rsync -avz -e ssh travegre@travegre.net: ../travegre.net/ the folder named "hm" that is held in travegre.net and is coppied along with all the other folders and data at travegre.net, gets deleted... (4 Replies)
Discussion started by: travegre
4 Replies

9. UNIX for Advanced & Expert Users

Why rsync deletes source directory?

Hi I have a strange problem. Sometimes when I execute the below command something wierd happens. rsync -avz -e ssh travegre@travegre.net: ../travegre.net/ the folder named "hm" that is held in travegre.net and is coppied along with all the other folders and data at travegre.net, gets... (1 Reply)
Discussion started by: travegre
1 Replies

10. UNIX for Dummies Questions & Answers

Multi line deletes

I would like to be able to delete the first n lines of a file from inside of a ksh script. I am not sure how to achieve this or if it is possible. Could someone please help. Thanks in advance. (5 Replies)
Discussion started by: rehoboth
5 Replies
Login or Register to Ask a Question