Tag Archives: linux news

Linux: Log Everyone Out Of The System

I can login as root user on Debian or Ubuntu/RHEL/CentOS Linux based system. I need to log everyone off to install new kernel and/or hardware. How do I do this on Linux? What is the best way to logout ALL USERS remotely over the ssh based session in Linux like operating systems?

Read answer to: “Linux: Log Everyone Out Of The System

Tweet this    Share on Facebook

Powered by WPeMatico

Nginx Redirect Mobile / Smart Phone Traffic To Mobile Version Of the Web Site

I am a new nginx user and I would like to redirect all mobile / smart phone users from www.example.com to m.example.com domain. How do I detect a mobile phone browser in nginx? How do I redirect all mobile users to sub-domain using regex based rules? How can I automatically redirects visitors on mobile devices to its mobile version at http://m.example.com/ and also allow mobile devices to the desktop website at www.example.com if visiting via http://www.example.com/?desktop=true?

Read answer to: “Nginx Redirect Mobile / Smart Phone Traffic To Mobile Version Of the Web Site

Tweet this    Share on Facebook

Powered by WPeMatico

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}’ $682444

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

Read answer to: “Awk Floating Point Number Addition Results Are Unexpected

Tweet this    Share on Facebook

Powered by WPeMatico

Linux: Find Out How Much Disk Space Left On Hard Drive

I am a desktop support professional with experience working in a corporate call center environment. Recently, I started to admin RHEL based IBM Linux server. How do I determine how much disk space left in my Linux server? How do I find out how much disk space I have in Linux for each partition?

Read answer to: “Linux: Find Out How Much Disk Space Left On Hard Drive

Tweet this    Share on Facebook

Powered by WPeMatico