Command line tools

Jul 2, 2021 sed vim productivity

Purpose

The purpose of this document is to flex my command-line and vim muscles.

Remove first n characters from a file

:%s/^………//g or :%s/^.\{,n\}//g

Remove last n characters from a file

:%s/……$//g or :%s/.\{,n\}$//g

grep “dimsum” /var/logs/syslog | awk ‘{ print $11}’ | sort -n | uniq -c | sort -nr | head

24 f43962d85f
23 8c13c10f48
22 892b7b0a4a
22 1f4214be46
20 7shdf8sjfk
Screen