Thursday, December 9, 2010

Linux tips

> ls -l | grep -v total | awk '{ S+=$5} END { print "Total = ",S, ", Average = ", S/NR, ", Entries = ", NR, ", Columnss = ", NF}'
Total = 70238 , Average = 4389.88 , Entries = 16 , Columnss = 9
================================================================
> x=2008
> y=1957
> echo "$[$x - $y]"
51
> echo "$(($x - $y))"
51

================================================================
> gunzip < /usr/share/man/man8/vgrename.8.gz | nroff -man less

================================================================
> for i in `find /usr/home -name '*.jar'`
> do
> jar tvf $i | grep Something 2>/dev/null
> if [ $? -eq 0 ]; then
> echo $i
> fi
> done

================================================================
> groovy -e "System.env.each { println it }"
> groovy -e "System.props.each { println it }"

No comments: