Unix

  • How to Get The First File in Unix

    In case you are looking files using ls or find command and only want to get the first file found, the command would be like. ls -l /any/path/filename*|sed -e ‘s///,/g’|awk -F “,” ‘{print $NF}’|head -1 Of course, you can also use it in find command. find /any/path/ -name “filename*” -type f|sed -e ‘s///,/g’|awk -F “,”…

  • How to Display Seconds in Unix File Timestamp

    Apparently, there’s no native shell command to show the seconds portion of a unix file timestamp. The nearest to this functionality is stat. However, it’s not always available in unix systems. I’m using HP-UX and it’s not installed on our server. Instead, I needed to use a one-line perl program shown below. perl -e .foreach(@ARGV){$t…

  • SpotVPS First Impressions

    After the unfortunate incident last week with NordicVPS, I decided to look for a new VPS host. As usual, I went to lowendbox and get the reviews in webhostingtalk. It’s there where I stumbled upon a promo from SpotVPS. As it turns out, SpotVPS is a low-cost VPS offering of ComfortHost.NET. And who are they?…

  • Apache Cannot Allocate Memory Problem

    For the past month, I have been encountering some problems with my WordPress installation. I keep getting the Error 500. I checked the log files and here’s what I found. (12)Cannot allocate memory: couldn’t create child process: /opt/suphp/sbin/suphp for