Skip to content
Chakradhar Rao Jonagam edited this page Aug 17, 2016 · 6 revisions

find all files of size greater than 50mb

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

article on uptime

http://www.howtogeek.com/194642/understanding-the-load-average-on-linux-and-other-unix-like-systems/

convert json to yml

for i in $(find . -name '*.json');do  python -c 'import sys,json,yaml;print(yaml.safe_dump(json.loads(sys.stdin.read()), default_flow_style=False))' < $i > ${i/json/yaml};done

Use output strings as command arguemtns for outer commands

docker images | grep 3.1.0.4 | awk '{print $1" "$2}' | awk '{print "docker tag -f "$1":"$2" "$1":3.2.0.46"}' | xargs -0 bash -c

To remove an attribute cpassword from json file

cat ShopUser.json | jq 'del(.cpassword)'
Clone this wiki locally