1
0
mirror of https://github.com/bregman-arie/devops-exercises.git synced 2025-07-15 23:54:32 +02:00
Files
devops-exercises/topics/shell/solutions/empty_files.md

21 lines
264 B
Markdown
Raw Permalink Normal View History

2021-11-07 17:54:06 +02:00
## 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
```