Skip to content

CLIDarkArts

Josh Schairbaum edited this page Nov 11, 2015 · 4 revisions

Global Find And Replace

find %{pattern} | xargs sed -i '' 's/%{old_text}/%{new_text}/'

Example

find **/*.rb | xargs sed -i '' 's/Goliath.env/ENVIRONMENT/'

Print Files Above A Certain Size:

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

Parse A JSON File

cat | python -c 'import json,sys;obj=json.load(sys.stdin);print obj;'

Ubuntu

List All Installed Packages

aptitude search '~i'