Monthly Archives: August 2013

Replacing a string with another in a text file using sed

sed -i ‘s/old-test/new-text/g’ filename This replaces the word old-test with the word new-text in the file named filename.

Posted in Uncategorized | Tagged , , , | Leave a comment

Delete files older than X days

find /path/to/folder -mtime +14 -exec rm {} \; This finds all files within that folder that are older than 14 days, then executes rm on them

Posted in Uncategorized | Tagged , , , , | Leave a comment