[Linux][awk]Implementation of arithmetic operations using awk


{ print “—————————————————————————” print “This script will do arithmetic operation (+, /, -, *) between two values ” print “command is num1 op num2 where op is the arithmetic command” print ” eg:- 2 * 3″ print “—————————————————————————” no1 = $1 no2 = $3 op=$2 if ( op == “*” ) ans = no1 *Continue reading “[Linux][awk]Implementation of arithmetic operations using awk”

[Linux][Shell script] print fibonacci series of 12 numbers


#!/bin/sh# Fibonacci series – eg:- “0 1 1 2 3 5 8 13 21 34 55 …” a=0 #First value of the seriesb=1 #Second value of the series#print the first value of the series.echo $a#print the second value of the series.echo $b#Now a small mathmatics for finding other numbers in the series . for IContinue reading “[Linux][Shell script] print fibonacci series of 12 numbers”

[Shell Script][bash]Finding factorial of a given number using shell script


#!/bin/bash #This script will print the factorial of the number passed as arguement . eg:- ./factorial.sh 4 will print 4! value number=$1 factorial=1 i=$number while [[ $i != 1 && $i != 0 ]] do factorial=`expr $factorial \* $i` i=` expr $i – 1 ` done echo “Factorial of $number is $factorial”

[Linux][Commands]How to find files by its size in a directory


find dir_name  -size  50M   –> This command is for finding files with size 50MB find dir_name  -size  -50M   –> This command is for finding files with size smaller  than 50MB find dir_name -size +50M   –> This command is for finding files with size bigger than 50MB   where the dir_name is theContinue reading “[Linux][Commands]How to find files by its size in a directory”

[Linux][C]How to display readable ASCII strings found in binary files


If you have one binary file and if you want to see the file content (readable ASCII strings ), then use Linux strings command  man strings ->  print the strings of printable characters in files eg: strings a.out which will print all the readable ASCII strings found  in the a.out file