Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

21
sunos/devfsadm Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, sunos]
source: https://github.com/tldr-pages/tldr.git
---
# 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`

21
sunos/dmesg Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, sunos]
source: https://github.com/tldr-pages/tldr.git
---
# 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`

21
sunos/prctl Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, sunos]
source: https://github.com/tldr-pages/tldr.git
---
# 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}}`

29
sunos/prstat Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, sunos]
source: https://github.com/tldr-pages/tldr.git
---
# 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}}`

30
sunos/snoop Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, sunos]
source: https://github.com/tldr-pages/tldr.git
---
# 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}}`

29
sunos/svcadm Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, sunos]
source: https://github.com/tldr-pages/tldr.git
---
# 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}}`

21
sunos/svccfg Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, sunos]
source: https://github.com/tldr-pages/tldr.git
---
# 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}}`

29
sunos/svcs Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, sunos]
source: https://github.com/tldr-pages/tldr.git
---
# 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)`

30
sunos/truss Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, sunos]
source: https://github.com/tldr-pages/tldr.git
---
# 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}}`