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
Answer / vipul dalwala
find . -name *.dat -maxdepth 3 -exec rm -f {} \;
| Is This Answer Correct ? | 10 Yes | 0 No |
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 |
What are environment variables?
What is sed in shell script?
What are the advantages of bash over all other shells?
How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output of ls -l command.
How to print all the arguments provided to the script?
What is scripting autism?
What does echo mean in scripting?
What does path stand for?
write a scwipt that a) takes exactly one argument, a directory name. b) if the number of argument is more or less than one,print a usage message c) if the argument is not adirectory, print another message d) for the given directory, print the five biggest files and the five files that were most recently modified. e) save the output to a file called q2output.
How to change our default shell?
What is meant by dos operating system?
Create a bash shell script that reads a line from the user consisting of 5 words and then prints them out in reverse order. Name this script "reverse.sh"