LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to delete files using rm command (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-delete-files-using-rm-command-731340/)

asifbasha 06-08-2009 12:10 AM

how to delete files using rm command
 
hai to all

i am using fedora 9 with gnome desktop , i am having folder that consist of various files with different extensions ,

if i execute rm -f *.c command then this will delete only files with .c extension .

if i execute rm -f *.html command then this will delete only files with .html extension .
how can i delete all files(not that directory) regardless of their extensions. is there any command ,please tell me

thanks in advance....

noctilucent 06-08-2009 12:14 AM

rm -f *

John VV 06-08-2009 01:01 AM

did you read
Code:

rm --help
--- or ---
man rm

???????????????????????????????????//

JulianTosh 06-08-2009 01:10 AM

Code:

find . -type f -exec rm {} \;
Removes files in current and subdirectories (but not subdirectories).

linuxlover.chaitanya 06-08-2009 02:13 AM

Yes man page would have given you all the answers though. Be aware that using -f option will be dangerous. Use -v option so that you know is happening and where you are executing the command. If you by mistake execute it on / it will delete everything and you will have no os to boot.


All times are GMT -5. The time now is 05:13 PM.