remove files

Hi,

How do i remove all the files that are present in the directory.. I know a way of doing this..that is by using *.* .. But my directory has executables or some files without extensions... So they are not getting deleted. What do i do to remove all of them?

Thanks,
Nisha

Hi,
it depends on what kind of user your are, what permission you've got. Root can delete without no problems. Commad rm -f *.* deletes.

rm -r *.* can be used too. If its your folder and you have access on it chmod and change the permission first.

Hi,

I also tried rm -f *.*..but in vain..it isn't deleting. how do i see what permissions i have got????

-Nisha

hope this can help...

su
enter your root password
cd to your directory
\rm *.*

or

\rm -r your directory

Hey,

Thanks for that. I changed the permissions and its working fine. I used rm -r *.* and it deleted both the directory and its contents.

Just kindly tell me this. Even when we create our own directory and files, the default permissions can only be given is it? so there is no way of deleting the files without the changing the permissions or what?

Thanks in Advance,
Nisha

Two things..... this looks like it's got more complicated than it needs to be:

1) To remove all files just use ''
The *.
that you have been using will only delete files that have the '.' character in the name.

2) If you want to remove the directory as well as its contents then you could just go up one level in the filesystem and do 'rm -rf dir_name'

Hey Thanks Peter. I got it working.
I never thought about this *. I learnt a new thing..

Thanks,
Nisha

:slight_smile: