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}}
-
Trace a process filtering output by system call:
truss -p {{pid}} -t {{system_call_name}}
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)
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
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}}
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
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
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}}
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}}
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}}
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.