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 filters explain sort with all the options available?

0 Answers  


Explain about debugging?

0 Answers  


How to make userdefined variables to available for all other shells?

4 Answers  


How to initialize a directory size to a variable??

2 Answers  


How to group the commands in shell scripting?

2 Answers   Polaris,


What is shell prompt?

0 Answers  


What does it mean to debug a script?

0 Answers  


What is console line?

0 Answers  


What is a shell made of?

0 Answers  


What is computer cli?

0 Answers  


How to know that your remote server is ruing smoothly or not in unix?

1 Answers  


What language is used in terminal?

0 Answers  


Categories