FAQ

I am a new CentOS Linux user. How do I install GNU mc (Midnight Commander) on Red Hat Enterprise Linux or CentOS Linux server version 5.x/6.x using bash command line?

{ 2 comments }

I am using awk to grep ‘foo’ from a text file and cacluate sum of field # 7. But, result is rounded to an integer. I need exact result such as 385858.66 and not 385858 using the following command:

grep ‘foo’ 2012-2013.txt | awk ‘BEGIN{ sum=0.0}{ sub(“,”,””,$7); sum +=$7}END{ print “$” sum}’
$682444

I want $682444.57 as output. How can I force “awk” to do floating point math?

{ 1 comment }

I have a data as follows :

foo bar 12,300.50
foo bar 2,300.50
abc xyz 1,22,300.50

How do I replace all , from 3rd field using awk and pass output to bc -l in the following format to get sum of all numbers:
12300.50+2300.50+1,22,300.50

{ 7 comments }

How do I send a header to my Web server (such as Nginx / Lighttpd / Apache / ISS) on a Apple OS X or Unix or Linux based system using a curl command line option for testing and debugging my web apps or server nodes behind a load balancer?

{ 3 comments }

I have turned on gzip compression as modern web browser supports and accepts compressed data transfer. However, I’m unable to do so with the wget command. How do I force wget to download file using gzip encoding?

{ 0 comments }

I‘m currently using Amazon EBS block level storage volumes for use with Amazon EC2 instances powered by Red Hat Enterprise Linux. This volume stores critical webapp and user data. We are moving out to another cloud provider. How do I find files such as *.logs, *.php, *.gz and few other file patterns and securely delete them so that no one can recover it ever?

{ 7 comments }

How do I find out my DNS server IP address assiged my my ISP under Unix or Linux operating system using command prompt? How do I find preferred dns server under Debian / Ubuntu / Fedora Linux desktop system?

{ 6 comments }