≡ Menu


I am login to a remote server using a ssh client. I am annoyed with the arrow key behavior during insert mode in Vim. As soon as I hit arrow keys, vim display A B C D on screen. How do I fix this problem under Linux, FreeBSD, OpenBSD, NetBSD, Apple OS X or Unix-like operating systems? How can I fix arrow keys that display A B C D on remote shell?
[click to continue…]

RHN yum command: Unable to read consumer identity Warning and Solution

I am using yum update command with RHN to upgrade packages installed on my server, but getting the following warning on screen :

yum update -y
Loaded plugins: product-id, protectbase, rhnplugin, security, subscription manager:
Updating certificate-based repositories.
Unable to read consumer identity
0 packages excluded due to repository protections
Setting up Update Process
Resolving Dependencies
--> Running transaction check

How do I get rid of this warning /error under RHEL 6 server?
[click to continue…]

HowTo: Listen Pandora In Europe ( Outside USA )

I have Pandora Internet Radio One subscription, and recently I moved to Europe for a few months as part of my work schedule. The service fully available only in the United States. How do I access Pandora one service in Europe? Can I get around it by using a proxy server installed on my own server located in USA at home or ISP data center?
[click to continue…]

Linux / Unix: Rsync Copy Hidden Dot Files and Directories Only

How do I use the rsync tool to copy only the hidden files and directory (such as ~/.ssh/, ~/.foo, and so on) from /home/jobs directory to the /mnt/usb directory under Unix like operating system?
[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: sed Command Print Only Matching Lines

I see many examples and man pages on how to do operations like search-and-replace using sed. But, I want to match a given string or a regular pattern expression and display on the screen. How do I print lines with matching pattern using sed command only under Unix like operating systems?
[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…]

HowTo: Install firefox-15.0.tar.bz2 in Linux

Idownloaded Firefox version 15.0 from mozilla ftp server. The name of file is firefox-15.0.tar.bz2. How do I install Firefox under any Debian / Ubuntu / Fedora or any Linux distribution?
[click to continue…]

Bash History: Correct / Repeat The Last Command With a Substitution

I often type the wrong command as follows under Linux bash shell:
rsync -av dir1 user@server1.cyberciti.biz:/path/to/dir1
cp -av file1*.txt file2*.txt /path/to/dest

I need to correct those command as follows:

rsync -av dir5 user@server1.cyberciti.biz:/path/to/dir1
cp -av delta1*.txt delta2*.txt /path/to/dest

How do I replace dir1 with dir5 or file with delta and repeat the last command under bash shell?
[click to continue…]

HowTo: grep Text Between Two Words in Unix / Linux

I got over 100s of HTML files in the following format:

 <title>Statistics for ABC LTD - January 2007 - Rang IDXYZZAZZZZ</title>
<body BGCOLOR="#E8E8E8" TEXT="#000000" LINK="#0000FF" VLINK="#FF0000">
<h2>Statistics for ABC LTF</h2>
Summary Period: January 2007<br />
Generated 01-Feb-2007 06:40 CET<br />
<hr />
<font SIZE="-1"></font></p></center><pre>
my data 1
my data 2
my data 3
my data 10000
my data N times

Generated by MyAppDbStatsWriter (UNIX) version 1.9b2

How do I extract text between two words (<PRE> and </PRE>) in unix or linux using grep command?
[click to continue…]