pid − Retrieve process identifiers


pid ?fileId? ___________________________


If the fileId argument is given then it should normally refer to a process pipeline created with the open command. In this case the pid command will return a list whose elements are the process identifiers of all the processes in the pipeline, in order. The list will be empty if fileId refers to an open file that is not a process pipeline. If no fileId argument is given then pid returns the process identifier of the current process. All process identifiers are returned as decimal strings.


Print process information about the processes in a pipeline using the SysV ps program before reading the output of that pipeline:

set pipeline [open "| zcat somefile.gz | grep foobar | sort -u"]
# Print process information
exec ps -fp [pid $pipeline] >@stdout
# Print a separator and then the output of the pipeline
puts [string repeat - 70]
puts [read $pipeline]
close $pipeline


exec(3), open(2)


file, pipeline, process identifier

More Linux Commands

mvins_wch(3ncurses) - insert a complex character and renditi
These routines, insert the complex character wch with rendition before the character under the cursor. All characters to the right of the cursor are moved one s

dumpcap(1) - Dump network traffic - Linux manual page.......
Dumpcap is a network traffic dump tool. It lets you capture packet data from a live network and write the packets to a file. Dumpcaps default capture file forma

btrfs-restore(8) try to restore files from a damaged btrfs f
btrfs restore is used to try to salvage files from a damaged filesystem and restore them into <path> or just list the tree roots. Since current btrfs-check(8) o

clientlib(3) - NNTP clientlib part of InterNetNews library
The routines described in this manual page are part of the InterNetNews library, libinn(3). They are replacements for the clientlib part of the NNTP distributio

Tcl_SetExitProc(3) - end the application or thread (and invo
The procedures described here provide a graceful mechanism to end the execution of a Tcl application. Exit handlers are invoked to cleanup the applications stat

setfattr(1) - set extended attributes of filesystem objects
The setfattr command associates a new value with an extended attribute name for each specified file. OPTIONS -n name, --name=name Specifies the name of the exte

SDL_mutexP(3) - Lock a mutex (Library - Linux man page).....
Locks the mutex, which was previously created with SDL_CreateMutex. If the mutex is already locked then SDL_mutexP will not return until it is unlocked. Returns

uri(7) - uniform resource identifier (URI), including a URL
A Uniform Resource Identifier (URI) is a short string of characters identifying an abstract or physical resource (for example, a web page). A Uniform Resource L

glTexCoord(3gl) - set the current texture coordinates.......
glTexCoord specifies texture coordinates in one, two, three, or four dimensions. glTexCoord1 sets the current texture coordinates to (s, 0, 0, 1); a call to glT

read(2) - read from a file descriptor - Linux manual page...
read() attempts to read up to count bytes from file descriptor fd into the buffer starting at buf. On files that support seeking, the read operation commences a

gnutls_session_get_data2(3) - API function - Linux man page
gnutls_session_get_data2.3 - Returns all session parameters, in order to support resuming. The client should call this, and keep the returned session, if he wan

glResetMinmax(3gl) - reset minmax table entries to initial v
glResetMinmax resets the elements of the current minmax table to their initial values: the maximum element receives the minimum possible component values, and t

We can't live, work or learn in freedom unless the software we use is free.