Skip to content

Instantly share code, notes, and snippets.

@jiromm
Last active February 7, 2022 18:45
Show Gist options
  • Save jiromm/ce628934a90433c56252 to your computer and use it in GitHub Desktop.
Save jiromm/ce628934a90433c56252 to your computer and use it in GitHub Desktop.
linux commands
# top 30 largest files
du -sb * | sort -nr | head -30
# directory count
ls -l | grep ^d | wc -l
# directory count (recursively)
ls -lR | grep ^d | wc -l
# directory size
du -ch | grep total
# empty trash
rm -rf ~/.local/share/Trash/*
# check free disk space
df -h
# Search the specific word in directory and show filenames
grep -H -R 'eval(' . | cut -d: -f1
# Find suspicious PHP files
find . -type f -name "*.php" -exec grep --with-filename "eval(\|exec(\|base64_decode(" {} \;
./virus.php: eval(base64_decode($_GET['a']));
# Find files
find . -print | grep -i '*.php'
# Search for a files which contains a word in directory
grep -r word *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment