Elogix is an incredibly powerful & fully responsive WordPress Theme.
Open
X

Archive for the 'Unix' Category

Expect Debug Mode Enable/Disable

Posted on April 23rd, 2013 · Posted in Blog, Linux, Unix

If you want to debug your expect program, just add the code below at the very top of your program. #!/usr/bin/expect -d Notice the -d at the end of the.. read more

How To Get Version of HP-UX

Posted on January 7th, 2013 · Posted in Blog, Unix

In case you wonder what version of HP-UX you are running, the command to use is uname. Here’s the syntax. uname -r The output will be something like this B.11.31

Add Admin Rights to Existing User in CentOS/Linux

Posted on December 30th, 2012 · Posted in Blog, Unix

One of the important things to do in setting up a VPS or any Linux webserver is to NOT use the root user after the initial setup. The reason is.. read more

Get IP Host Name in Unix and Windows

Posted on August 10th, 2012 · Posted in Blog, Linux, Unix

Suppose you have the ip address but need to get the hostname (ip name), you can use the commands below. Windows Syntax nbtstat -a [ip address]

Equivalent of grep in DOS/Windows

Posted on July 31st, 2012 · Posted in Blog, Linux, Unix

I hardly know scripting commands in DOS/Windows Console so I struggle everytime I encounter situations when I need to use them. Case in point is searching for text in files… read more

Count Occurrence of Character in String Unix Shell

Posted on May 29th, 2012 · Posted in Blog, Linux, Unix

How do we exactly count the occurrence of a particular character in a string in bash scripting? Well, there’s quite a number of ways of doing this. Here’s the simplest.. read more

Suppress Error Message of cp (copy)

Posted on May 4th, 2012 · Posted in Blog, Linux, Unix

There are times when you don’t need to know if the command you fired threw an error or not. That’s exactly what I needed in one of the systems I.. read more

Hide sqlldr Oracle Password in PS Command

Posted on February 10th, 2012 · Posted in Oracle, PL/SQL, Unix

Our internal audit team has raised an issue on some scripts exposing database user, password and tns. You see, all you need is an access to unix shell and run.. read more

How to Get The First File in Unix

Posted on December 13th, 2011 · Posted in Blog, Linux, 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.. read more

How to Display Seconds in Unix File Timestamp

Posted on December 11th, 2011 · Posted in Blog, NGINX, Unix

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.. read more