###### find dangling symlinks find . -type l | while read f; do if [ ! -e "$f" ]; then ls -l "$f";fi;done ### last changed config files find /etc -cmin -60 ### files with nouser , nogroup under /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin find {,/usr{,/local}}/{,s}bin -nouser find {,/usr{,/local}}/{,s}bin -nogroup ### packages installed except from our package management system find /usr/bin | xargs rpm -q --whatprovides | grep "not owned" ### in-place replacement at file perl -i -p -e "s/value/new_value/g" file ### find files owned by root and has sticky bit find / -perm /1000 -user root -ls ### find files owned by root and has sgid bit find / -perm /2000 -user root -ls ### find files owned by root and has suid bit find / -perm /4000 -user root -ls ### analyze inode usages inside an fs find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -rn | more ### colomn merging in command line # echo 1 > a # echo 3 >> a # echo 2 > b # echo 4 >> b # paste a b > c # cat c 1 2 3 4 # cat c | tr '\t' ' ' 1 2 3 4 # ### find which process created short-lived files # cd /folder # while true > do > ls -lrt | tail -1 | awk '{print $NF}' |xargs lsof > sleep 1 > done COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 15204468 was 465u VREG 10,7 2097152 115 com.ab.platform.branchdata.BranchDataService.getApprovalsData.data ### calculate sum with awk # cat file | awk '{sum+=$1} END {print sum}' ### calculate average with awk # cat file | awk '{ sum += $1; n++ } END { if (n > 0) print sum / n; }'