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

Write a command sequence to find the count of each word?

0 Answers  


write a non recursive shell script that accepts any number of arguments and prints them in the reverse order

3 Answers  


How will you print the login names of all users on a system?

0 Answers  


Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

0 Answers  


How shell works?

1 Answers  






What will happen to my current process when I execute a command using exec?

0 Answers  


What is web script?

0 Answers  


How do I read a .sh file?

0 Answers  


What is the difference between break and continue commands?

0 Answers  


When should shell programming/scripting not be used?

0 Answers  


What is k shell?

0 Answers  


write a shell program to check wheather a given string is pallindrome or not?

4 Answers  


Categories