≡ Menu

grep command

Clear Squid Proxy Cache And Re-create the Cache Directories

How do I clear squid cache? How do I re-create the cache directories on a server where Squid version 3.x is currently running in Linux or Unix based server?
[click to continue…]

Linux: Find Out What Is Using TCP Port 80

How do I find out what is listing or using tcp port number 80 on Linux based systems using command line options?
[click to continue…]

CentOS / RHEL: Install KornShell (KSH)

I am porting ksh script from Sun/Oracle Unix to Linux. How do I install ksh (KornShell) in CentOS / Fedora / Red Hat Enterprise Linux? How do I run and test ksh script on RHEL/CentOS Linux?
[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…]

CentOS / RHEL: Check If A Service Is Running Or Not

How do I find out if a service such as MySQL or Apache running on my Centos/RHEL/Fedora Linux server?
[click to continue…]

HowTo: Save The Output Of A Linux/Unix Command To A File

I am new Linux and Unix-like system user who recently switched from MS-Windows XP. How do I save the output of a Linux / Unix ls command to a file named "lists.txt" using command prompt or POSIX shell such as SH/KSH/BASH?
[click to continue…]

Linux: Find Out What Process Are Using Swap Space

The top and free command display the total amount of free and used physical and swap memory in the server. How do I determine which process is using swap space under Linux operating systems? How do I find out swap space usage of particular process such as memcached?
[click to continue…]

HowTo: grep All Sub-directory For Files

How do I grep all sub directories? How can I use grep command through all sub-directories on Linux or Unix like operating systems? How do I use grep to find pattern including all subdirectories on OS X/BSD/Unix-like operating systems?
[click to continue…]

Gracefully Restart Nginx Web Server After Changes Made In a Config File

I know how to gracefully restart Apache web server under Unix like operating system. I made changes to nginx.conf. How do I gracefully restart Nginx web server? How do I make changes in a Nginx server config file to take effect without restarting the Nginx server itself without interrupting users' current session?
[click to continue…]

MySQL/MariaDB Server: Bind To Multiple IP Address

I have MySQL/MariaDB database system running on a FreeBSD/Linux server. The server has multiple ip address. The mysqld used by many websites hosted on two other CentOS Linux based servers. I would like to bind MySQL sever running on a Linux or Unix-like server to more than one IP address such as,, and How can I bind mysqld to multiple ips?
[click to continue…]