#!/bin/bash # find single biggest file in an installed deb-pkg: export PKG=vim; for i in $(dpkg -L PKG) ; do if [[ -f "$i" ]] && [[ ! -L "$i" ]]; then ls -lh1 $i ;fi; done | sort -k 5 -hr | head -1 | cut -d " " -f 5,9- # find all links in the fs, that link to a specific target: find / -type l -exec readlink -nf {} ';' -exec echo " -> {}" ';' | grep "/bin/bash" # extract base64-coded binary within a given tag in an xml (1st match) cat file.xml | sed -n -e 's/.*\(.*\)<\/ns5:Daten>.*/\1/p' | base64 -d # prettify PATH-Output: echo $PATH | sed s/\:/\\n/g # check for open ports on target for i in 80 443; do echo -e '\x1dclose\x0d' | telnet google.com $i >/dev/null; echo "$i : $?"; done # find biggest directories in a given path without leaving the current filesystem dir="/var/opt/gitlab"; for i in $(ls $dir); do mountpoint -q $dir/$i || du -shx $dir/$i ; done | sort -rh | head