Miscellaneous Solaris Commands

This cheat sheet provides new and experienced users with a number of miscellaneous commands for the Solaris™ operating system.

SUN patch files and freeware http://sunsolve.sun.com http://sunfreeware.com
Forget root password boot —s cdrom find out root partition with “format” command mount /dev/dsk/c0t0d0s0 /mnt (suppose c0t0d0s0 is root part.) edit /mnt/etc/shadow
Disable auto-logout feature for tcsh Put following line in .cshrc or .tcshrc unset autologout
Disable serial device (modem) login. edit /etc/inittab remove sc:234:respawn:/usr/lib/saf/sac —t 300
Show export file systems on host_name. showmount —e host_name
Check RPC services on host_name. rpcinfo —p host_name
Show what dynamic libraries needed by program. ldd program LD_LIBRARY_PATH is the search path for dynamic libraries.
Add new user account. useradd —d homedir —u UID —g GID —c “comment” —s shell
Save manual page for command “foo” in pure text. man foo | col —b > foo.txt
Add solaris package file. pkgadd —d pkgfile
Reconfiguration system after adding new hardware. boot —r
Show current run level. who —r
Check if new floppy/cdrom is inserted. volcheck —v
Show which program is using the cdrom (or floppy). fuser —u [-k] /cdrom
Show settings in eeprom. /usr/sbin/eeprom
Show system information. /usr/sbin/prtconf —vb
Find set UID to root program. find / -type f —perm -4000 —user root —print
Set screen resolution, color depth for M64 frame buffer. m64config —res 1024x768x75 —depth 24 (ffbconfig on Ultra -60)
File system check, answer “y” to all questions. fsck —F ufs —y /dev/rdsk/c0t0d0s0
Set CDE screen background. xv —root —quit foo.gif
Run a script in /etc/init.d directory. /etc/init.d/script {start | stop}
Construct new file system after format. newfs —v /dev/rdsk/c0t0d0s6
Reconfiguring the system. /usr/sbin/sys-unconfig
Apply patch to system. patchadd [options] patch
Backup of all files. ufsdump 0uf /dev/rmt/0 /
Restore inetd.conf file from backup ufsrestore xf /dev/rmt/0 etc/inetd.conf
Install recommended patch cluster. install_cluster —q -nosave
set TCP/IP parameters ndd
change settings in eeprom eeprom ie: eeprom security-mode=full