Skip to content

Commit 6c4f32a

Browse files
committed
ANSWERED: Write a script to remove all the empty files in a given dir.
1 parent accce12 commit 6c4f32a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: README.md

+16
Original file line numberDiff line numberDiff line change
@@ -4800,6 +4800,7 @@ Using the keyword <code>read</code> so for example <code>read x</code> will wait
48004800
<details>
48014801
<summary>Write a script to determine whether a host is up or down</summary><br><b>
48024802

4803+
**EXAMPLE ONE**
48034804
```
48044805
#!/bin/bash
48054806
SERVERIP=<IP Address>
@@ -4817,6 +4818,21 @@ fi
48174818

48184819
<details>
48194820
<summary>Write a script to remove all the empty files in a given directory (also nested directories)</summary><br><b>
4821+
4822+
**EXAMPLE ONE**
4823+
```
4824+
#! /bin/bash
4825+
for x in *
4826+
do
4827+
if [ -s $x ]
4828+
then
4829+
continue
4830+
else
4831+
rm -rf $x
4832+
fi
4833+
done
4834+
```
4835+
48204836
</b></details>
48214837

48224838
<a name="shell-scripting-advanced"></a>

0 commit comments

Comments
 (0)