1
0
mirror of https://github.com/bregman-arie/devops-exercises.git synced 2025-07-12 23:50:28 +02:00
Files
devops-exercises/topics/shell/solutions/empty_files.md
abregman 99c4e02ecf Rename exercises dir
Name it instead "topics" so it won't be
strange if some topics included "exercises" directory.
2022-08-02 01:53:56 +03:00

21 lines
264 B
Markdown

## Empty Files
### Objectives
1. Write a script to remove all the empty files in a given directory (including nested directories)
### Solution
```
#! /bin/bash
for x in *
do
if [ -s $x ]
then
continue
else
rm -rf $x
fi
done
```