From 6c4f32af1b023b34d9b2ff7a7113b88714c554d5 Mon Sep 17 00:00:00 2001 From: Austin Songer Date: Tue, 21 Jan 2020 21:48:34 +0000 Subject: [PATCH] ANSWERED: Write a script to remove all the empty files in a given dir. --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 830ffc5..1f2cc2f 100644 --- a/README.md +++ b/README.md @@ -4800,6 +4800,7 @@ Using the keyword read so for example read x will wait
Write a script to determine whether a host is up or down
+**EXAMPLE ONE** ``` #!/bin/bash SERVERIP= @@ -4817,6 +4818,21 @@ fi
Write a script to remove all the empty files in a given directory (also nested directories)
+ +**EXAMPLE ONE** +``` +#! /bin/bash +for x in * +do + if [ -s $x ] + then + continue + else + rm -rf $x + fi +done +``` +