Skip to content

Instantly share code, notes, and snippets.

@ATpoint
Created April 3, 2025 12:18
Show Gist options
  • Save ATpoint/8fa5bca79d556890aa357303c5afeac1 to your computer and use it in GitHub Desktop.
Save ATpoint/8fa5bca79d556890aa357303c5afeac1 to your computer and use it in GitHub Desktop.
Reminders for checking files

Some reminders useful when admining a server

# List all files with that extension 1GB or larger

find . -type f -size +1G -print | grep -E "\\.lif$|\\.lifext$" > lif_files.txt

# Print combined size of all files in that file in GB
awk '
  {
    cmd = "du -b \"" $0 "\""
    cmd | getline size_line
    close(cmd)
    split(size_line, parts)
    total += parts[1]
  }
  END {
    printf "Total size: %.2f GB\n", total / 1073741824
  }
' lif_files.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment