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



Create a bash shell script that removes all files whose names end with a "~" from your h..

Answer / cdude

#/bin/bash

rm `find . -name *~`

Is This Answer Correct ?    14 Yes 3 No

Create a bash shell script that removes all files whose names end with a "~" from your h..

Answer / alok

find . -name *~ -exec rm -i {} \;

It will ask you before deletion of this file

Is This Answer Correct ?    6 Yes 2 No

Create a bash shell script that removes all files whose names end with a "~" from your h..

Answer / sasmita

rm ' find /home -name "$~" -print' cleanup.sh

Is This Answer Correct ?    4 Yes 0 No

Create a bash shell script that removes all files whose names end with a "~" from your h..

Answer / somnath

#!/bin/bash

find /home -name "*~" | xargs rm

Is This Answer Correct ?    1 Yes 1 No

Create a bash shell script that removes all files whose names end with a "~" from your h..

Answer / stevemc

#!/bin/bash

cd ~

find . -name "*~" | xargs rm

Is This Answer Correct ?    1 Yes 2 No

Create a bash shell script that removes all files whose names end with a "~" from your h..

Answer / kuldeep singh

#!/bin/sh

cd | ls -lR | grep "~$" | rm -f

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More Shell Script Interview Questions

What are "c" and "b" permission fields of a file?

0 Answers  


Is shell scripting difficult?

0 Answers  


how will you find the total disk space used by a specific user?

0 Answers  


What is the default shell of solaris?

0 Answers  


What is subshell?

0 Answers  






How will you connect to a database server from linux?

0 Answers  


What is the purpose of scripting?

0 Answers  


Which is better perl or shell scripting?

0 Answers  


What is meant by $1 in shell script?

0 Answers  


How u convert string "hi pravin how are you?" to "Hi Pravin How Are You?"

12 Answers   Cap Gemini,


What is a batch file used for?

0 Answers  


What does chmod do?

0 Answers  


Categories