≡ Menu


CentOS / RHEL 6: Install Midnight Commander File Manager

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?
[click to continue…]

Awk Floating Point Number Addition Results Are Unexpected

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}'

I want $682444.57 as output. How can I force "awk" to do floating point math?
[click to continue…]

Awk Find And Replace Fields Values

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:
[click to continue…]

Linux / Unix: curl Command Pass Host Headers

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?
[click to continue…]

wget Command: Download Compressed File By Sending gzip Headers

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?
[click to continue…]

Linux AWS: Find And Delete All Files Securely So That No One Can Recover It Ever

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?
[click to continue…]

Linux / Unix: Find Out DNS Server IP Address / Names

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?
[click to continue…]

Linux: warning: CUPSEXT could not be loaded. Please check HPLIP installation.

I'm trying to install latest version of Hewlett-Packard's Linux Imaging and Printing software (HPLIP) for my office jet printer. In order to install latest version of HPLIP I removed the hplip-gui, hplip, hplip-cups, hplip-data, hpijs, and hpijs-ppds Debian Linux packages However, I'm getting the following error:

Debian warning: CUPSEXT could not be loaded. Please check HPLIP installation.

How do I fix this error while installing hplip-3.12.9.run under Debian Linux 6.0.5 amd64 bit?
[click to continue…]

Red Hat / CentOS Command To Find Dell Service Tag

How do I find out my Dell server service tag using command line under RHEL / Fedora / Red Hat / CentOS / Scientific Linux operating systems?
[click to continue…]

Linux / Unix: whoami Command Examples

whoami command

I am a new Linux and Unix system user. How do I listing my own username? How can I display my login name on Linux or Unix-like systems?
[click to continue…]