≡ Menu

Delete All Files And Folders In Linux

How do I delete all files and folders stored in /home/jerry/movies directories under Linux operating systems?

You need to the rm command.

Open a terminal or shell (bash) prompt and type the following command to delete everything in /home/jerry/movies

cd /home/jerry/movies
rm -rf *

OR you can use the following single command:

rm -rf /home/jerry/movies/

Please note that all folders and files including movies will be deleted. Once deleted you will not able to get back your data. So be careful when typing rm -rf command.

{ 5 comments… add one }

  • Udana May 14, 2013, 10:12 am

    ~/.local/share/Trash/files# rm -rf *

  • Vivek July 3, 2013, 5:15 pm

    Thanks for the tip about deleting all files from directory. This site always helps me for Linux tips. Thanks again !!

  • Prashanth April 16, 2014, 5:54 pm

    If i want to delete a directory containing files for which i dont have the access

    can i delete those files too

    If yes can you share me the command

    • pankit October 14, 2014, 8:36 am

      rm -rfv nFolders/

  • Thanjayan January 22, 2015, 9:18 am

    I am new to linux environment and using Centos 6.2 Version OS and found that some of the folder getting deleted automatically and the deleted files and folder are from recent access. How it is happening ? Do i need to change any basic settings after OS installed? Please support me to resolve this issue.

Leave a Comment

   Tagged with: , , , , ,