LINUX PROCESS LAB

Run it. Inspect it. Open it up.

A visual playground for understanding what a Linux process actually is: PIDs, parent processes, scheduling, sleeping, memory, file descriptors, system calls, signals, and the process lifecycle.

● BROWSER SIMULATION — DATA BELOW IS MODELED, NOT YOUR REAL SYSTEM
student@linux-lab:~/process-demo
bash
NEW PID 4242
simulated process activity



            

        
SIMULATED PROCESS

clock-demo

● NEW
PID
4242
PPID
4100
CPU
0.0%
RSS
1.6 MiB
VSZ
3.1 MiB
FDs
3
SYSCALLS
0
WRITES
0
UPTIME
0.0s
Mode:
Speed: 1×

1. Process lifecycle

Watch the simulated process move through states.

TASK STATE
NEW created
READY waiting for CPU
RUNNING on CPU
SLEEPING waiting
ZOMBIE terminated
EXITED reaped
NEW means the process has just been created. Press Run to begin the simulation.

2. CPU scheduling

One small process can spend most of its time waiting.

RUNNING SLEEPING

In write → sleep mode, the process briefly runs, performs a modeled write, then waits. In busy loop mode it continuously has work to do.

3. What is inside a process?

A process is more than a PID.

1
PID / PPID

PID identifies the process. PPID identifies its parent.

2
Virtual address space

Code, data, heap, shared libraries and stack are mapped into the process's virtual memory.

3
File descriptors

stdin, stdout and stderr are three common file descriptors.

4
Kernel-managed state

Linux tracks scheduling state, credentials, signals, memory mappings, open files and more.

This is a simplified model of a process's virtual address space.
TEXT
64 KiB
DATA
24 KiB
BSS
12 KiB
HEAP
56 KiB
LIBRARIES
1.1 MiB
STACK
32 KiB

File descriptors are small integers referring to open resources.

0
stdin

Standard input — normally connected to the terminal.

1
stdout

Standard output — where normal program output goes.

2
stderr

Standard error — commonly used for diagnostics.

A simplified trace of what the simulated process is doing. Real Linux system calls can be observed with strace.

fork()

Make a child

A process asks the kernel to create a child. The child receives its own PID and initially resembles the parent.

execve()

Replace the program

The child can replace its current program image with another executable. The PID normally remains the same.

waitpid()

Reap the child

A parent can wait for a child to terminate. This is important because an exited child can temporarily remain as a zombie.

4. Real Linux Lab

Now connect the model to a real Linux system. Enter a PID below. Every command can be copied and "run" inside this page to display representative Linux output. The browser does not execute commands on your machine.

Important: The output produced by the Run buttons is sample output. It is intentionally modeled so students can learn what the real commands look like before running them on Linux. Commands involving kill can change process state when executed on a real system.
Tip: echo $$ shows your current shell PID.
ps — process snapshot START HERE


                
Shows a compact snapshot of one process. Compare PID, PPID, state, CPU, memory, runtime and command line.
ps -f — parent relationship PID / PPID


                
The full-format view makes PID, PPID, user and command information easier to see.
ps aux — wider process view OVERVIEW


                
Shows CPU, memory, user and command information across a broader process listing.
pstree — process hierarchy PARENTS / CHILDREN


                
Shows processes as a tree. This makes parent/child relationships easier to understand.
/proc/PID/status KERNEL VIEW


                
Linux exposes detailed process information through the /proc pseudo-filesystem.
/proc/PID/maps MEMORY


                
Shows virtual memory mappings. Compare this with the simplified Memory tab above.
/proc/PID/fd FILE DESCRIPTORS


                
Lists the process's open file descriptors.
top — live process view LIVE


                
A continuously updating process monitor. Great for comparing sleeping and CPU-heavy processes.
strace — system calls ADVANCED


                
Attaches to a running process and displays system calls such as write, nanosleep and exit.
lsof — open resources FILES / SOCKETS


                
Shows files, devices, pipes, sockets and other resources associated with the process.
kill — SIGSTOP CHANGES STATE


                
Sends SIGSTOP to stop a process. The browser simulation does not send it; the Run button only displays sample output.
kill — SIGCONT RESUME


                
Sends SIGCONT to allow a stopped process to continue executing.
ps -L — threads THREADS


                
Processes can contain multiple threads. This command helps reveal their relationship.

5. Suggested student experiment

Move from the model to a real Linux process.

1
Run the simulation

Start clock-demo. Watch RUNNING alternate with SLEEPING.

2
Switch to busy loop

Notice how a continuously runnable process behaves differently from one that frequently sleeps.

3
Create a real process

On Linux, run: sleep 300 in another terminal.

4
Find its PID

Try: pgrep sleep or ps aux | grep sleep.

5
Inspect it

Put that PID into the Real Linux Lab. Start with ps and /proc/PID/status.

6
Change its state

On your own test process, try SIGSTOP and SIGCONT, then inspect it again.