Saturday, 13 September 2014

How to Change Your Command Prompt in UNIX or Linux

If you do not like your command prompt in UNIX or Linux, you can change it with the export PS1= command. In the example below, I started off with a command prompt of UBUNTU > :

UBUNTU > 

... then I changed it to show the name of the directory I was in. Here is one way to do this:

UBUNTU > export PS1='`pwd` > '
/home/andrew > cd Java
/home/andrew/Java > cd /
/ >

... and here is another:

/ > export PS1='$PWD > '
/ > cd
/home/andrew > cd Java
/home/andrew/Java > 

Finally, I changed it to say Andrew's PC: 

/home/andrew/Java > export PS1="Andrew's PC: "
Andrew's PC:

Friday, 12 September 2014

prstat -Z

If you have a Solaris server split up into zones, you can log on to the global zone and use prstat –Z. This produces a report like the one below. The last few lines show how much memory and CPU is being used by each zone. As usual, click on the image, if necessary, to enlarge it and bring it into focus: