{"id":235656,"date":"2026-04-25T18:00:00","date_gmt":"2026-04-25T22:00:00","guid":{"rendered":"https:\/\/news-you-need.com\/index.php\/2026\/04\/25\/theres-a-linux-command-that-shows-you-exactly-what-any-running-process-is-doing\/"},"modified":"2026-04-25T18:25:07","modified_gmt":"2026-04-25T22:25:07","slug":"theres-a-linux-command-that-shows-you-exactly-what-any-running-process-is-doing","status":"publish","type":"post","link":"https:\/\/news-you-need.com\/index.php\/2026\/04\/25\/theres-a-linux-command-that-shows-you-exactly-what-any-running-process-is-doing\/","title":{"rendered":"There&#8217;s a Linux command that shows you exactly what any running process is doing"},"content":{"rendered":"<p><a href=\"https:\/\/www.makeuseof.com\/linux-command-shows-you-exactly-what-any-running-process-is-doing\/\">There&#8217;s a Linux command that shows you exactly what any running process is doing<\/a><\/p>\n<p><a href=\"https:\/\/www.makeuseof.com\/linux-command-shows-you-exactly-what-any-running-process-is-doing\/\">https:\/\/www.makeuseof.com\/linux-command-shows-you-exactly-what-any-running-process-is-doing\/<\/a><\/p>\n<p>Publish Date: <a href=\"publish_date]\">2026-04-25 18:00:00<\/a><\/p>\n<p>Source Domain: <a href=\"www.makeuseof.com\">www.makeuseof.com<\/a><\/p>\n<p>I have noticed from experience that when my Linux programs fail, it&#8217;s often a subtle event that can leave you confused or unsure of what actually went wrong. When I have fallen back to top, htop, or even the more preferred iotop, the best I get is data relating to CPU and memory usage, with no real insight into what the failing process is actually doing.<\/p>\n<p>At such times, it&#8217;s not enough to know that something is wrong. I usually want to see why. The strace -p command has made a real difference. Once I attach it to a running process, it shows every call that process makes.<\/p>\n<h2 id=\"see-what-a-process-is-doing-in-real-time\">\n                        See what a process is doing in real time<br \/>\n               <\/h2>\n<h3 id=\"attaching-strace-and-reading-the-first-lines-of-output\">\n            Attaching strace and reading the first lines of output<br \/>\n    <\/h3>\n<p>If you really need to understand strace, you just have to use it. It&#8217;s an observability tool, but quite different from inotifywait. Attach it to a running process using this format: sudo strace -p . And if you don&#8217;t have the PID, any of the commands below will help you find it. I use Firefox in the examples:<\/p>\n<p>    pidof firefox<br \/>pgrep -a firefox<br \/>ps aux | grep firefox    <\/p>\n<p>The strace -p command almost instantly starts to produce results, and running it on an actual Firefox process can produce this result:<\/p>\n<p>    epoll_wait(5, [], 1024, 999) = 0<br \/>futex(0x7f3a2c0, FUTEX_WAIT, 1, NULL) = 0<br \/>openat(AT_FDCWD, &#8220;\/proc\/self\/maps&#8221;, O_RDONLY) = 7<br \/>read(7, &#8220;&#8230;&#8221;, 4096) = 4096    <\/p>\n<p>Each line shows a call name first, then its arguments, and finally a return value. The lines represent requests Firefox makes to the kernel. From the above result, here&#8217;s what I deduce:<\/p>\n<ul>\n<li>\n                                        epoll_wait(&#8230;) = 0: The process is waiting for an event, but nothing has arrived.\n                        <\/li>\n<li>\n                                        futex(&#8230;) = 0: The process is coordinating between threads.\n                        <\/li>\n<li>\n  &#8230;<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.makeuseof.com\/linux-command-shows-you-exactly-what-any-running-process-is-doing\/\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a Linux command that shows you exactly what any running process is doing https:\/\/www.makeuseof.com\/linux-command-shows-you-exactly-what-any-running-process-is-doing\/&#8230;<\/p>\n","protected":false},"author":1,"featured_media":235657,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/static0.makeuseofimages.com\/wordpress\/wp-content\/uploads\/wm\/2026\/04\/using-the-strace-linux-command.jpg?w=1600&h=900&fit=crop","fifu_image_alt":"","footnotes":""},"categories":[48],"tags":[71],"class_list":["post-235656","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/posts\/235656"}],"collection":[{"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/comments?post=235656"}],"version-history":[{"count":1,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/posts\/235656\/revisions"}],"predecessor-version":[{"id":235658,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/posts\/235656\/revisions\/235658"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/media\/235657"}],"wp:attachment":[{"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/media?parent=235656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/categories?post=235656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/tags?post=235656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}