Showing posts with label one-liners. Show all posts
Showing posts with label one-liners. Show all posts

Monday, August 30, 2010

Simple Search & Replace in VI

In vi, this will replace any (uppercase or lowercase variation of the word "cat", or CAT, or cAt, with the word "dog" globally in the entire file.


%s/[Cc][Aa][Tt]/dog/g

Find files modified in the last 90 minutes

Find files modified in last 90 minutes:
find / -mmin -90

Quick one-liner to find large files on Linux

find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'