# pid command

The pid BASIC program displays the UNIX
PID of a D3 process.

**For Windows:**Not Supported

## Syntax

```
pid {port.number} {(options}
pid * {pid.to.search} {(options}
```

## Parameter(s)

| options | p | Directs output to the system printer via spooler. |
| --- | --- | --- |
The D3 process is specified by a port number (PIB), all
D3 processes currently connected if the argument is an asterisk, or
if there is no argument in the current process.

The first form
displays the UNIX PID or the specified D3 port number (PIB). The second
form displays the UNIX PIDs of all the D3 processes currently connected
to the virtual machine. An asterisk precedes the current process.
If a list of PIDs to search is provided, a plus sign displays before
each process found in the list. This form is useful to determine whether
a specified UNIX process, identified by its PID, is connected to the
virtual machine.

## Example(s)

34726 is the current UNIX PID.

```
pid

34726
```
14525 is the UNIX PID for D3 PIB 22.

```
pid 22

14525
```
Displays the PIDs of all D3 processes and searches to
determine if the UNIX processes 36978 and 2345 are D3 processes. This
command was executed on (D3) line 2. The UNIX process 36978 is connected
to the virtual machine on line 3, and the process 2345 is not connected
to this virtual machine.

```
pid * 36978 2345

PIB PID PIB PID
=== ====== === ======
0 35002 * 2 6513
+ 3 36978 4 42611
```

## See also

- [%kill() function](https://d3codex.com/pickbasic-flashbasic/percent-kill-function/)
- [%pgetpid() function](https://d3codex.com/pickbasic-flashbasic/percent-pgetpid-function/)
- [kill command](https://d3codex.com/tcl/kill-command/)
- [PID](https://d3codex.com/definitions/pid/)
- [psr command](https://d3codex.com/tcl/psr-command/)

---
Source: https://d3codex.com/tcl/pid-command/ - part of the D3Codex reference.
