how to delete all the files with extension .dat rom a
directory tree from root to third level in a single unix
command?

Answers were Sorted based on User's Feedback



how to delete all the files with extension .dat rom a directory tree from root to third level in a..

Answer / vipul dalwala

find . -name *.dat -maxdepth 3 -exec rm -f {} \;

Is This Answer Correct ?    10 Yes 0 No

how to delete all the files with extension .dat rom a directory tree from root to third level in a..

Answer / sreekanth turuka

grep -l "*.dat" /dir1/dir2/dir3 | rm

Is This Answer Correct ?    0 Yes 0 No

how to delete all the files with extension .dat rom a directory tree from root to third level in a..

Answer / saravanan

rm `find -maxdepth 2 -name *.dat`

Is This Answer Correct ?    0 Yes 0 No

how to delete all the files with extension .dat rom a directory tree from root to third level in a..

Answer / lakshman

1st find the .dat file and place in file
example :
find . -name *.date > temp

then add rm infrent of paths in that file adn run the script.
example :
:%s/\.\//rm \.\//

open temp file run above vi command and rm the script

example :
sh temp

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Shell Script Interview Questions

What is the difference between a 'thread' and a 'process'?

3 Answers  


What is bourne shell scripting?

0 Answers  


Is shell a scripting language?

0 Answers  


What is the command to find out users on the system?

0 Answers  


How to get the first line from a file using just the terminal?

0 Answers  






Is cmd a shell?

0 Answers  


Hi Friends, I am currently Undergoing Course On Testing.I am Planning To Keep Fake Resume.Can any One tell me the ways to Prepare i.e, Real Time experience For Manual Testing. With Regards, Vikram

1 Answers  


How do I start a shell script?

0 Answers  


How do I open the shell prompt?

0 Answers  


What is bash command used for?

0 Answers  


I want to read all input to the command from file1 direct all output to file2 and error to file 3, how can I achieve this?

1 Answers  


What is INODE?

2 Answers  


Categories