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 basename in shell script?

0 Answers  


Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.

0 Answers  


c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l

0 Answers  


What is INODE?

2 Answers  


What are the additional egrep symbols?

2 Answers  


Why should we use shell scripts?

0 Answers  


How to take input values from the user?

4 Answers  


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

0 Answers  


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

0 Answers  


What does chmod do?

0 Answers  


how is the oppurtunities for unix in the software

1 Answers  


What are the Different types of shells?

5 Answers  


Categories