How can you tell if a long-running process is actually making progress or stuck? On Linux, there are several ways to check.
Detailed process information via
/proc/<pid>/status
The/procfilesystem provides extensive information about every running process. By runningcat /proc/<pid>/status, you can see key details such as the number of threads, memory usage, and the process state. TheState:field shows whether the process is running (R), sleeping (S), or in uninterruptible sleep (D), giving clues about its current activity. This file also listsvoluntary_ctxt_switches, which counts how many times the process voluntarily gave up the CPU (typically while waiting for I/O), andnonvoluntary_ctxt_switches, which counts how many times it was preempted by the scheduler to let another process run. High voluntary context switches combined with low CPU usage usually indicate the process is mostly waiting rather than stuck.Output and resource inspection
Linux allows you to follow what a process is printing to stdout usingtail -f /proc/<pid>/fd/1. This works whether stdout is redirected to a file or attached to a terminal. Additionally, runninglsof -p <pid>lists all files, sockets, and network connections the process has open, helping you determine whether it is blocked on I/O or waiting for network responses.System calls inspection
For deeper observation,strace -p <pid>shows the system calls a process is executing. Watching repeated calls or blocked operations can reveal whether a process is actively working, waiting for I/O, or potentially stuck in a loop.Monitor logs with
journalctl
If the process runs as a systemd service, you can usejournalctl -u <service_name> -fto follow its logs in real time. This is particularly useful for background tasks or daemons that don’t produce stdout output. You can see whether the service is actively reporting progress, encountering errors, or retrying operations.