SolarisCheatSheet

From GangusInternetWiki

Jump to: navigation, search

Some useful commands, especially for those who are more familiar with Linux.

Contents

Terminal Environment

Some users may prefer to change their default shell from sh to something with additional features such as bash or ksh. This can be set in /etc/passwd on a per user basis.

The TERM environment variable may also need to be set, depending on the SSH application that is being used, such as:

$ TERM=xterm
$ export TERM

Shutdown / Reboot

  • shutdown: init 0
  • reboot: init 6

Starting and Stopping Services

  • List services: svcs
  • List broken / services with problem(s): svcs -x
  • Start a service: svcadm enable service-name
  • Stop a service: svcadm disable service-name (use -t for 'temporary', i.e. non-persistent on reboots)
  • After changing configuration files: svcadm refresh service-name

Packages

  • List all installed packages: pkginfo
  • Check if package 'foo' is installed: pkginfo | grep foo
  • Remove/uninstall a package 'foo': pkgrm foo
  • Add/install a package './foo.pkg': pkgadd -d .

Performance Monitoring

  • 'top' equivalent: prstat. Use prstat -Z to include some summary statistics (such as memory usage).
  • To get full arguments from ps: /usr/ucb/ps -auxww
Personal tools