# Operating Systems >  Does rm * remove all files

## smita76

Does this remove all the files

----------


## tagro82

Depends on the permissions of files.
rm * will remove all the files in a given directory if delete permissions are there for the files.
Its a very dangerous command

----------


## lakshmananindia

if we give rm -rf then it deletes the hole contants including subdirectories.
be aware while using rm.

----------


## lakshmi20074u

rm -rf * will work :Smile:

----------


## bathija

what will happen if rm -rf is run from root directory.

----------


## lakshmananindia

> what will happen if rm -rf is run from root directory.


It will delete everything. Don't try this.

----------


## PAULSK

rm * will delete all the files in sufficient permissions are there.bt anway it will not delete the directories directly.

----------


## Sunil.M

rm * ---- > Delete's all the files in the current directory.
rm -r * ---> Delete's both the files and the directories in the current directory.

Pls note the above commands don't delete the Hidden Files. 

Hidden files are the files which start with .filename , inorder to view the file we need to use the ls -a option.

To delete these files also use a . , i.e: 
rm *.*

Note:- All above commands will work only if u have sufficient privileges to do so  :Smile:

----------


## tcsonly

> Does this remove all the files


Try to read the man page first, & understand, instead of waiting for 5 days to get the 1st response.

----------

