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 |
How to print pid of the current shell?
What is the difference between running a script as ./scriptname.sh and sh scriptname.sh
Script S1 (which copies .dat files from one directory1 to another directory2) run continuously. Write Script S2 which kills S1 first, compresses all .dat files in directory1 and directory2 successfully, re-run Script S1 and stops self i.e. S2.
I want to connect to a remote server and execute some commands, how can I achieve this?
What is the use of "shift" command in passing parameters?
Write a command sequence to find the count of each word?
What is INODE?
Is cmd a shell?
What does path stand for?
How will you emulate wc –l using awk?
How to enable the shell to know what program should be run to interpret the script?
What is the difference between a variable and value?