Batch File Rename

by Kyle on

Leave off the final pipe to /bin/sh to test:

ls foo*.jpg | awk '{ print("mv "$1" "$1) }' | sed 's/foo/bar/2' | /bin/sh

Delete Zero Size Files

by Kyle on

This will delete all files in the current directory that have a size of zero.

find . -type f -size 0k -exec rm {} \; | awk '{ print $8 }'

Print Active Connections To Port 80 Per IP Address

by Rick on

netstat -plan | grep :80 | grep -E "(EST|LIST)" | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -nk 1

Hide Sidebar