Create a bash shell script that removes all files whose
names end with a "~" from your home directory and
subdirectories. Name this script "cleanup.sh"
Answers were Sorted based on User's Feedback
Answer / alok
find . -name *~ -exec rm -i {} \;
It will ask you before deletion of this file
| Is This Answer Correct ? | 6 Yes | 2 No |
Answer / kuldeep singh
#!/bin/sh
cd | ls -lR | grep "~$" | rm -f
| Is This Answer Correct ? | 1 Yes | 4 No |
what are command line arguments? what is the need of those?
Which is better perl or shell scripting?
How will you pass and access arguments to a script in linux?
What does $# stand for?
how to search for vowels a,e,i,o,u appearing in the same sequence in a file
What is the first line in every perl script called?
what are special characters and explain how does text varies by the usage of single quotes,double quotes and back quotes?
What is the first line in a shell script?
how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?
How can I send a mail with a compressed file as an attachment?
What makes c shell a more preferable option than the bourne shell?
How would you compare the strings in a shell script?