How remove all files in a directory linux?



How remove all files in a directory linux?..

Answer / Priyanka Choudhary

To remove all files in a directory (excluding the directory itself), you can use the `find` command with the `-type f` option to search for files and the `-exec rm {} ;` action to remove them. For example: `find . -type f -exec rm {} ;`.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Linux Commands Interview Questions

Enlist some linux networking and troubleshooting commands?

1 Answers  


What is the makefile in c?

1 Answers  


What is the difference between kill and kill in linux?

1 Answers  


In which File is Static IP address given so that it becomes Permanent ?

10 Answers   DCM, Wipro,


What signal is ctrl c?

1 Answers  


What are runlevels in linux?

1 Answers  


The ‘logout’ built in command is used to

1 Answers  


How will retrieves incoming mails from different web sites

4 Answers   HP, Wipro,


How do you execute more than one command or program from a single command line entry?

1 Answers  


What does bash stand for?

1 Answers  


what is first RHEL 5.x version support ext4 filesystem?

2 Answers  


How do I find my user id in linux?

1 Answers  


Categories