Skip to content

Instantly share code, notes, and snippets.

@aih
Created October 21, 2021 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aih/cf8467558ecc9a9093d40adf5027d92b to your computer and use it in GitHub Desktop.
Save aih/cf8467558ecc9a9093d40adf5027d92b to your computer and use it in GitHub Desktop.
Command line utility (written by GH Copilot) to list files greater than a certain size
files_bigger_than() {
local file_path="$1"
local size="$2"
local file_size=$(stat -c%s "$file_path")
if [ "$file_size" -gt "$size" ]; then
echo "$file_path"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment