SUN Solaris Unix Commands and Scripts

Solaris Unix Commands & Scripts for Sun Microsystems

Below are some commands and scripts that are used by the team here at Harman Research.  They were mostly used on Solaris 7, 8, 9 and 10 systems.

Also, feel free to check out our Oracle page , the Oracle SQL Scripts or the SQL Server page.

Check out the the Books/Manuals that we use Regularly.


Versions of Solaris Explained

SunOS is the core operating system comprising the kernel, utilities and basic libraries.  Solaris is the broader environment comprising SunOS, OpenWindows and networking support. In other words, SunOS is a component of Solaris.

SunOS and Solaris relate to each other as follows:

For example, when one does a 'uname -a' this reports that the server has SunOS 5.6 installed which means that it actually got Solaris 2.6 installed.

SUN OS VersionIs Solaris Version
SunOS 5.4Solaris 2.4
SunOS 5.5Solaris 2.5
SunOS 5.5.1Solaris 2.5.1
SunOS 5.6Solaris 2.6
SunOS 5.7Solaris 7
SunOS 5.8Solaris 8
SunOS 5.9Solaris 9
SunOS 5.10Solaris 10

How can we tell if Solaris OS is running 32 bit or 64 bit

Use the isalist command to determine whether the machine is running the 32-bit or 64-bit operating system. If you are running the 64-bit operating system on an UltraSPARC machine, then isalist will list sparcv9 first

How to boot in 32 or 64 bit mode

1To boot a 32-bit kernel, at the ok prompt type:
3ok boot [disk or net] kernel/unix
5To boot a 64-bit kernel (default), at the ok prompt type:
7ok boot [disk or net] kernel/sparcv9/unix
9ok boot [disk or net]

Run job in batch now:

1at -s now <

Show current process active

1ps -efa

Show process information

1psrinfo -v

Show version of unix

1uname -a

Display System Configuration

1prtvtoc /dev/dsk/c0t0d0s0

Query Disk space

1df -k disk space in kilobytes
3du -sk disk space summary in kilobytes

How To Configure Sun 450 Hot swap disk drives

11\. drvconfig
32\. disks

Remove all files and sub-directories

1rm -r \*

Move all files from one directory to another using tar pipe

1from directory /var
3mkdir /var1
5cd /var
7tar cf - . | (cd /var1 && tar xBf -)

Directory compare (don't show files that are the same)

1dircmp -s /var /var1

Give User execute permission on a file

1chomod u+x filename gives execute permission to the owner.

Find command to find in current directory and sub directory

1find . -name "dbmslogmnr.sql" -print

DATE Command

1date mmddHHMM\[\[cc\]yy\]
3example "date 022610221998"

Get DATE from another unix box

1rdate pluto

Find Command for certain size files

1find . -size +10000c
3This example say find all the file  10000 bytes.

Find command to find a word in the directory and sub directory

1 find . -exec grep -ls pkzip {} \\;

Posts in this Series