Unix

Firstly we need to make a distinction here, the difference between Unix and Linux. For me, Unix is closed source and always paid for, whereas Linux is open source and mostly free. Take a look at History of Unix and Linux for some history information.

In terms of the organisation of information, then this section on Unix covers information that is only relevant to different Unix products, anything that is common to Linux will appear there. So in principle the Linux section should be bigger than this smaller Unix section. Let's see if this works!

Unix Differences

Sometimes you can end up pulling your hair out with the differences between the flavours of Unix, Linux and Mac OS X, in which case Rosetta Stone for Unix is a very useful site.

AIX

This is IBM's flavour of Unix and was born out of System V and BSD, I believe and getting its name from "Advanced Interactive Executive". One useful reference page is IBM AIX commands you should not leave home without, which is a good starting point. However the AIX command reference is at IBM Knowledge Center - Commands make sure you pick the right version.

Here is a summary of some Aix specific commands:

  • aixpert - sets security settings to harden your server, see docs for details
  • killall - on AIX this works differently in that without any parameters it will kill all processes you started except those starting the killall process
  • lsgroup - lists members of a group, including ids, to list all groups use lsgroup ALL
  • lsuser - lists user information including id, groups and the shell
  • df - display file systems, there is no -h option like Linux but there is -g, -m, -k which give GB, MB and KB respectively
  • oslevel - use the -s option to get the current version, with the man page to interpret the numbers
  • smit - very handy System Management tool
When using ldd on AIX it very often returns .a files, or archives. These archives allow the contained files to be referenced externally. However there is a way to see inside, with the ar command, for example:
ar -w /usr/lib/libcrypt.a.


A good source of Open Source projects compiled for AIX is AIX Open Source Packages | Main / AIX Open Source Packages however it is not always clear how stuff is built, for example which version of OpenSSL is used by VSFTPD.

AIX Quirks

This might not be an AIX thing but I had a tar file which I could not extract, because it contained a directory path off root that did not exist. So, first I created a directory to extract to and then used tar -xvf the_tar_file.tar -C /home/geoff/new_dir which worked a treat.

If you execute cat /proc/device-tree/serial-number you will get the serial number of the box, however if you look in /proc/device-tree/ you'll find other interesting stuff too.

AIX Port Analysis

Often on Linux people use lsof to establish which process is listening on a given TCP/IP port. However this is not generally available on AIX and hence a different approach has to be taken. First use netstat as follows:
netstat -Aan | grep LISTEN
This gives you all the listening ports, so you might want to use another grep to shorten the list. The output will give you a socket id in the first column, something like "f100050000b05bb6" which is needed for the next stage, so pick up the number and do this:
rmsock f100050000b05bb6 tcpcb
This will give you the pid for the process, which you can then lookup via the ps command as follows:
ps -ef | grep <pid>
A little more cumbersome but still possible. It is worth nothing that if you get a malloc error from rmsock, then you either need to reboot or apply a fix, see IBM IV68229: RMSOCK COMPLAINS WITH "GETPROCDATA: MALLOC FAILED" APPLIES TO AIX 7100-03 - United Kingdom for more details