Select Page

Linux Basics

Sed Replace the first occurrence of a string in a file, and print the result sed ‘s/find/replace/’ filename Replace all the occurrences of a string in a file, and print the result sed ‘s/find/replace/g’ filename Replace all occurrences of an...

Git Tips: git diff without a/ b/ prefixes

Intro Prefixes a/ and b/ represents source and destination file paths. git diff man page: https://git-scm.com/docs/git-diff It is typical to copy the file name with double-click select and paste or ctrl/cmd+click open directly in your favorite editor. But, prefixes a/...

JSON Parsing with jq

Considering cat file.json be any JSON input from a file or API response, etc. Read the whole file with JSON aware viewer jq ‘.’ file.json # OR cat file.json | jq ‘.’ The rest of the write-up assumes the file being read with cat format before...