Skip to content

Instantly share code, notes, and snippets.

View nalamchaitanya's full-sized avatar
👋

Nalam V S S Krishna Chaitanya nalamchaitanya

👋
View GitHub Profile
@nalamchaitanya
nalamchaitanya / sed.sh
Last active June 27, 2016 14:02
Find and replace a string all over a file in linux terminal.
sed 's/<string to find>/<string to replace>/g' <file to find and replace>
# sed is a tool to find and replace in terminal.
# the thing in quotations is the main gist of command.
# s means search.
# g means do the operation globally over the file.
@nalamchaitanya
nalamchaitanya / awk.sh
Last active June 16, 2016 06:11
All hacks related to awk
awk -F ',' '{print $1,$2}' <filename> #Divides the ',' separated file and prints the column 1 and 2 by separting with space.
awk -F ',' '{a[$1]++;}END{print $1,a[$1]}' <filename> # Gives the frequency of words in file.
@nalamchaitanya
nalamchaitanya / Miscellaneous.sh
Last active June 15, 2016 12:37
Various code snippets useful in ubuntu terminal.
lsb_release -a #gives the version of ubuntu.