SunOS

devfsadm

devfsadm Administration command for /dev. Maintains the /dev namespace. More information: https://www.unix.com/man-page/sunos/1m/devfsadm. Scan for new disks: devfsadm -c disk Cleanup any dangling /dev links and scan for new device: devfsadm -C -v Dry-run - output what would be changed but make no modifications: devfsadm -C -v -n

dmesg

dmesg Write the kernel messages to stdout. More information: https://www.unix.com/man-page/sunos/1m/dmesg. Show kernel messages: dmesg Show how much physical memory is available on this system: dmesg | grep -i memory Show kernel messages 1 page at a time: dmesg | less

prctl

prctl Get or set the resource controls of running processes, tasks, and projects. More information: https://www.unix.com/man-page/sunos/1/prctl. Examine process limits and permissions: prctl {{pid}} Examine process limits and permissions in machine parsable format: prctl -P {{pid}} Get specific limit for a running process: prctl -n process.max-file-descriptor {{pid}}

prstat

prstat Report active process statistics. More information: https://www.unix.com/man-page/sunos/1m/prstat. Examine all processes and reports statistics sorted by CPU usage: prstat Examine all processes and reports statistics sorted by memory usage: prstat -s rss Report total usage summary for each user: prstat -t Report microstate process accounting information: prstat -m Print out a list of top 5 CPU using processes every second: prstat -c -n {{5}} -s cpu {{1}}

snoop

snoop Network packet sniffer. SunOS equivalent of tcpdump. More information: https://www.unix.com/man-page/sunos/1m/snoop. Capture packets on a specific network interface: snoop -d {{e1000g0}} Save captured packets in a file instead of displaying them: snoop -o {{path/to/file}} Display verbose protocol layer summary of packets from a file: snoop -V -i {{path/to/file}} Capture network packets that come from a hostname and go to a given port: snoop to port {{port}} from host {{hostname}} Capture and show a hex-dump of network packets exchanged between two IP addresses: snoop -x0 -p4 {{ip1}} {{ip2}}

svcadm

svcadm Manipulate service instances. More information: https://www.unix.com/man-page/linux/1m/svcadm. Enable a service in the service database: svcadm enable {{service_name}} Disable service: svcadm disable {{service_name}} Restart a running service: svcadm restart {{service_name}} Command service to re-read configuration files: svcadm refresh {{service_name}} Clear a service from maintenance state and command it to start: svcadm clear {{service_name}}

svccfg

svccfg Import, export, and modify service configurations. More information: https://www.unix.com/man-page/linux/1m/svccfg. Validate configuration file: svccfg validate {{path/to/smf_file.xml}} Export service configurations to file: svccfg export {{servicename}} > {{path/to/smf_file.xml}} Import/update service configurations from file: svccfg import {{path/to/smf_file.xml}}

svcs

svcs List information about running services. More information: https://www.unix.com/man-page/linux/1/svcs. List all running services: svcs List services that are not running: svcs -vx List information about a service: svcs apache Show location of service log file: svcs -L apache Display end of a service log file: tail $(svcs -L apache)

truss

truss Troubleshooting tool for tracing system calls. SunOS equivalent of strace. More information: https://www.unix.com/man-page/linux/1/truss. Start tracing a program by executing it, following all child processes: truss -f {{program}} Start tracing a specific process by its PID: truss -p {{pid}} Start tracing a program by executing it, showing arguments and environment variables: truss -a -e {{program}} Count time, calls, and errors for each system call and report a summary on program exit: truss -c -p {{pid}}