From 53932f32f5ffc6126ca296f80f280f41e756cb73 Mon Sep 17 00:00:00 2001 From: Guilherme Beltramini Date: Wed, 9 Apr 2025 19:43:06 -0300 Subject: [PATCH] Add command to find empty files --- commands/files/empty-files.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 commands/files/empty-files.sh diff --git a/commands/files/empty-files.sh b/commands/files/empty-files.sh new file mode 100755 index 0000000..343b680 --- /dev/null +++ b/commands/files/empty-files.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -euo pipefail + +##? Find empty files. +##? +##? Usage: +##? files empty-files [] +##? +##? Options: +##? Path to the directory to search in [default: .] + +source "${CLI_DIR}/core/helpers.sh" +parse_help "$@" +declare path + +path=${path:-.} +msg_color="gray" + +echo_color >&2 "$msg_color" "Empty files in '$path':" +find "$path" -type f -empty + +echo_done