www.linode.com
Open in
urlscan Pro
2606:4700::6812:7f04
Public Scan
URL:
https://www.linode.com/docs/guides/use-the-ps-aux-command-in-linux/
Submission: On April 28 via manual from US — Scanned from DE
Submission: On April 28 via manual from US — Scanned from DE
Form analysis
3 forms found in the DOMGET https://www.linode.com/
<form role="search" method="get" action="https://www.linode.com/" class="c-search"><label for="s">Search</label>
<input type="search" placeholder="Search Linode" name="s">
<input type="submit" value="Search">
</form>
https://login.linode.com/signup
<form action="https://login.linode.com/signup" data-turbo="false"><input type="hidden" name="promo" value="DOCS32SAFC">
<button type="submit" target="_blank" class="bg-transparent hover:bg-gray-800 text-white text-md font-semibold py-2 px-4 border border-white hover:border-gray-800 rounded"> Sign Up</button>
</form>
POST https://delighted.com/t/iVc7nAYL?referrer=%2Fdocs%2Fguides%2Fuse-the-ps-aux-command-in-linux%2F
<form data-turbo="false" x-data="{}" :action="'https://delighted.com/t/iVc7nAYL?referrer=' + encodeURIComponent(window.location.pathname)" method="post" target="_blank" novalidate=""
action="https://delighted.com/t/iVc7nAYL?referrer=%2Fdocs%2Fguides%2Fuse-the-ps-aux-command-in-linux%2F">
<div class="flex flex-col items-center">
<h2 id="delighted">Your Feedback Is Important</h2>
<p class="text-base text-titlecolor md:text-lg mb-6 mt-2 text-center">Let us know if this guide made it easy to get the answer you needed.</p><button type="submit"
class="btn p-4 rounded-md border-2 border-gray-400 hover:border-brand hover:text-brand text-sm sm:text-lg" value="Feedback" name="feedback"> Provide Feedback</button>
</div>
</form>
Text Content
Linode is now part of Akamai. LEARN MORE ❯ * Search * Partners * Docs * Support * Sales * Careers * Log In English * English * Español * Why Linode * Products * Solutions * Marketplace * Pricing * Community * Sign Up * Mobile * Why Linode * Products * Solutions * Marketplace * Pricing List * Community * About Us * Docs * Partners * Support * Careers * Contact Sales * Log In * Press Center * Legal Center * Sign Up Search FEATURED Cloud Spectator Benchmark Report Cloud Block Storage Access Report WHY LINODE * Choosing Linode * Support Experience * Predictable Pricing * Cloud Simplified * Free Bundled Services * Global Infrastructure GET TO KNOW US BETTER * About Linode * Customer Stories * Linode for Business * Alternative Cloud * Linode vs. Competitors * Open Cloud * What is Cloud Computing? FEATURED Free Bundled Services Discover our no-cost security, networking, maintenance, and monitoring solutions. Learn More View All Products COMPUTE * Dedicated CPU * Shared CPU * High Memory * GPU * Bare Metal * Kubernetes STORAGE * Block Storage * Object Storage * Backups DATABASES * Managed Databases * MySQL SERVICES * Managed * Professional Services NETWORKING * Cloud Firewall * DDoS Protection * DNS Manager * NodeBalancers * VLAN DEVELOPER TOOLS * Cloud Manager * API * CLI * Terraform Provider * Images * Integrations * StackScripts * Monitoring * Users & Permissions FEATURED Dev Mukherjee @ Anomaly Innovation Down Under and Beyond: From Virtualization to Electric Vehicles Read Dev's Story View All Solutions SOLUTIONS * Digital Agencies * eLearning * Higher Education * Machine Learning * Managed Hosting * Multicloud * SaaS * Video Streaming * Website Hosting FEATURED Cloud Pricing Calculator Estimate your cloud costs. Price and configure Linode features to match your needs. Launch Calculator PRICING * Pricing List * Cloud Estimator * Cloud Pricing Calculator FREE EBOOK The MSP's Guide to Modern Cloud Infrastructure Discover one of the best-kept secrets in building a scalable, thriving, modern Managed Service Provider business. Download COMMUNITY * Overview * Q&A * Developer Portal * Blog * Beta Program ENGAGE WITH US * Content Resources * Events * Hackathons * Newsletter * Press Center * Affiliate Program * Customer Referral Program * Startup Program * Swag Store * Promotional Offers Explore docs 1. Docs Home 2. Guides 3. Quick Answers 4. Linux 5. * Contents Contents CONTENTS 1. The ps command 1. Command Options 2. View All of Your System’s Processes 3. Viewing the Process Hierarchy 4. The aux shortcut 2. Next Steps 1. Use top as an Alternative to the ps Command 3. More Information 4. Your Feedback Is Important Filtered by search term 1. Docs Home 2. List Sections Tiles SEARCH RESULTS results matching results NO RESULTS Previous Next FILTERS Filters ( ) All Add tags All 1. Docs Home 2. Guides 3. Quick Answers 4. Linux 5. USING THE PS AUX COMMAND IN LINUX Updated Friday, August 20, 2021, by James Turner * Report an Issue * View File * Edit File * Share on Twitter * Share on Facebook * Share on Hacker News > Traducciones al Español > Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que > usted esté viendo una traducción generada automáticamente. Estamos trabajando > con traductores profesionales para verificar las traducciones de nuestro sitio > web. Este proyecto es un trabajo en curso. Create a Linode account to try this guide with a $100 credit. This credit will be applied to any valid services used during your first 60 days. Sign Up The ps aux command is a tool to monitor processes running on your Linux system. A process is associated with any program running on your system, and is used to manage and monitor a program’s memory usage, processor time, and I/O resources. Since the ps aux command displays an overview of all the processes that are running, it is a great tool to understand and troubleshoot the health and state of your Linux system. This guide provides an introduction to the ps aux command with brief examples to help you interpret its output. THE PS COMMAND The ps command without any options displays information about processes that are bound by the controlling terminal. ps The command returns a similar output: PID TTY TIME CMD 285 pts/2 00:00:00 zsh 334 pts/2 00:00:00 ps The default output of the ps command contains four columns that provide the following information: * PID: The process ID is your system’s tracking number for the process. The PID is useful when you need to use a command like kill or nice, which take a PID as their input. * TTY: The controlling terminal associated with the process. Processes that do not originate from a controlling terminal and were initiated by the system at boot are displayed with a question mark. * TIME: The CPU usage of the process. Displays the amount of CPU time used by the process. This value is not the run time of the process. * CMD: The name of the command or executable that is running. The output only includes the name of the command or executable and does not display any options that were passed in. COMMAND OPTIONS The ps command accepts three different styles of options; UNIX, BSD, and GNU. You can use a mix of each style, however, you may notice inconsistent behavior across Linux distributions. * When using UNIX-style options, your option(s) must be preceded by a dash (-) and can be grouped together. For example, the -aux options in the ps -aux command is preceded by a dash when using the UNIX style. * When using BSD-style options with the ps command, you must exclude the dash (-), however, you can group your options. For example, notice the ps aux command’s options; aux is formatted in the BSD style. * GNU-style options are preceded by two dashes (--), and are reserved for long options. For example, the ps --quick-pid 10946 command uses the long option --quick-pid to display running process information by a specific PID. In the example, 10946 is the process PID. VIEW ALL OF YOUR SYSTEM’S PROCESSES By default, the ps command displays only the processes associated with your current terminal session. However, you may want to view all the processes that the current user owns, for example if you have multiple terminal sessions running for the same user. In that case, issue the ps x command. Also, notice that the command is using the BSD-style option. The ps x command returns an additional column called sate information (STAT). This column can display a large number of possible values depending on the process it displays. For example, a lowercase s indicates that the process is a session leader (i.e., the root process). A capital S means that the process is in an interruptible sleep state, and is waiting for some event, like user input. R means that the command is actively running. T means that the process has stopped; like when you enter control-Z in the vi text editor. The + means it is a foreground process. Take a look at the following example and notice the different states for each process displayed in the STAT column: ps x PID TTY STAT TIME COMMAND 285 pts/2 Ss 0:00 -zsh 343 pts/2 T 0:00 vi foo 351 pts/3 Ss+ 0:00 -zsh 439 pts/2 R+ 0:00 ps -x VIEWING THE PROCESS HIERARCHY The init process is the first process started by the Linux kernel when a system boots. Every other process on your system is a child of the init process. You can view this hierarchy using the ps command’s e and H options. The e option causes ps to list all processes in the system, regardless of the owner or controlling terminal. The H option formats the CMD column’s data to display the parent-child relationship between processes. ps -He PID TTY TIME CMD 1 ? 00:00:00 init 227 ? 00:00:00 init 228 ? 00:00:00 init 229 pts/0 00:00:15 docker 240 ? 00:00:00 init <defunct> 247 ? 00:00:00 init 248 pts/1 00:00:10 docker-desktop- 283 ? 00:00:00 init 284 ? 00:00:00 init 285 pts/2 00:00:00 zsh 343 pts/2 00:00:00 vi 528 pts/2 00:00:00 ps 349 ? 00:00:00 init 350 ? 00:00:00 init 351 pts/3 00:00:00 zsh Alternatively, you can get a prettier output with a few more columns by using the ps -axjf command. ps -axjf PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND 0 1 0 0 ? -1 Sl 0 0:00 /init 1 227 227 227 ? -1 Ss 0 0:00 /init 227 228 227 227 ? -1 S 0 0:00 \_ /init 228 229 229 229 pts/0 229 Ssl+ 1000 0:15 | \_ docker 227 240 227 227 ? -1 Z 0 0:00 \_ [init] <defunct> 227 247 227 227 ? -1 S 0 0:00 \_ /init 247 248 248 248 pts/1 248 Ssl+ 0 0:10 \_ /mnt/wsl/docker-desktop/docker-desktop-proxy 1 283 283 283 ? -1 Ss 0 0:00 /init 283 284 283 283 ? -1 S 0 0:00 \_ /init 284 285 285 285 pts/2 559 Ss 1000 0:00 \_ -zsh 285 343 343 285 pts/2 559 T 1000 0:00 \_ vi foo 285 559 559 285 pts/2 559 R+ 1000 0:00 \_ ps axjf 1 349 349 349 ? -1 Ss 0 0:00 /init 349 350 349 349 ? -1 S 0 0:00 \_ /init 350 351 351 351 pts/3 351 Ss+ 1000 0:00 \_ -zsh The additional columns provide the following information: * PPID: Displays the parent process ID. In the above example, the vi command has a PPID of 285, which matches the PID of the Z shell process running above it. * SID: This column displays the session ID. The value is usually the same as the PID of the process that started the chain. * PGID: This ID shows the parent group process ID. * TPGID: This is the terminal sessions ID with which the process is associated. If there is no terminal that is associated, then -1 is displayed. * UID: The user ID associated with the process is displayed in this column. THE AUX SHORTCUT Now that you understand the basics of the ps command, this section covers the benefits to the ps aux command. The ps aux displays the most amount of information a user usually needs to understand the current state of their system’s running processes. Take a look at the following example: ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.0 892 572 ? Sl Nov28 0:00 /init root 227 0.0 0.0 900 80 ? Ss Nov28 0:00 /init root 228 0.0 0.0 900 88 ? S Nov28 0:00 /init zaphod 229 0.0 0.1 749596 31000 pts/0 Ssl+ Nov28 0:15 docker root 240 0.0 0.0 0 0 ? Z Nov28 0:00 [init] <defunct> root 247 0.0 0.0 900 88 ? S Nov28 0:00 /init root 248 0.0 0.1 1758276 31408 pts/1 Ssl+ Nov28 0:10 /mnt/wsl/docker-desktop/docker-desktop-proxy root 283 0.0 0.0 892 80 ? Ss Dec01 0:00 /init root 284 0.0 0.0 892 80 ? R Dec01 0:00 /init zaphod 285 0.0 0.0 11964 5764 pts/2 Ss Dec01 0:00 -zsh zaphod 343 0.0 0.0 23764 9836 pts/2 T 17:44 0:00 vi foo root 349 0.0 0.0 892 80 ? Ss 17:45 0:00 /init root 350 0.0 0.0 892 80 ? S 17:45 0:00 /init zaphod 351 0.0 0.0 11964 5764 pts/3 Ss+ 17:45 0:00 -zsh zaphod 601 0.0 0.0 10612 3236 pts/2 R+ 18:24 0:00 ps aux The ps aux command displays more useful information than other similar options. For example, the UID column is replaced with a human-readable username column. ps aux also displays statistics about your Linux system, like the percent of CPU and memory that the process is using. The VSZ column displays amount of virtual memory being consumed by the process. RSS is the actual physical wired-in memory that is being used. The START column shows the date or time for when the process was started. This is different from the CPU time reported by the TIME column. NEXT STEPS The ps command has many other available options. For example, ps allows you to customize output columns so you can view your system’s data in a format you prefer. You can filter based on the user, process name, or terminal. You can tell ps to print its output more verbosely and to ignore your screen width. You can spend more time learning what else ps can accomplish by reading its man-page on your Linux system. man ps USE TOP AS AN ALTERNATIVE TO THE PS COMMAND The top command is also a good tool to use to monitor your system’s processes. One benefit to the top command is that it updates its values and statistics in real time. You can also sort its output by CPU usage, and it allows you to kill a process using a semi-graphical UI. If you’d like to learn more about the top command, check out the Using top to Monitor Server Performance guide. MORE INFORMATION You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials. * Backing Up Your Data This page was originally published on Monday, January 25, 2021. linux * Report an Issue * View File * Edit File * Share on Twitter * Share on Facebook * Share on Hacker News -------------------------------------------------------------------------------- YOUR FEEDBACK IS IMPORTANT Let us know if this guide made it easy to get the answer you needed. Provide Feedback -------------------------------------------------------------------------------- Join the conversation. Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site. Please enable JavaScript to view the <a href=http://disqus.com/?ref_noscript>comments powered by Disqus.</a>comments powered by Disqus © 2003-2022 Linode LLC. All rights reserved. FOLLOW US * Twitter * Instagram * YouTube * LinkedIn * GitHub WHY LINODE * Choosing Linode * Support Experience * Predictable Pricing * Cloud Simplified * Free Bundled Services * Global Infrastructure * Customer Stories * Linode for Business * Alternative Cloud * Linode vs. Competitors * Open Cloud * What is Cloud Computing? COMPANY * About * Leadership * Partners * Press Center * Careers * Legal * Cookie Preferences PRODUCTS * Products Overview * Dedicated CPU * Shared CPU * High Memory * GPU * Bare Metal * Kubernetes * Block Storage * Object Storage * Backups * Managed Databases * MySQL * Cloud Firewall * DDoS Protection * DNS Manager * NodeBalancers * VLAN * Managed * Professional Services * Cloud Manager * API * CLI * Terraform Provider SOLUTIONS * Solutions Overview * Digital Agency * eLearning * Higher Education * Machine Learning * Managed Hosting * Multicloud * SaaS * Video Streaming * Website Hosting MARKETPLACE * Browse Marketplace * Submit Marketplace App PRICING * Pricing List * Cloud Estimator * Cloud Pricing Calculator COMMUNITY * Community Overview * Q&A * Developer Portal * Blog * Events * Hackathons * Content Resources * Affiliate Program * Beta Program * Customer Referral Program * Startup Program * Swag Store * Documentation * Distributions * Cloud Computing Terms * Promotional Offers CONTACT * Support * Contact Sales * System Status * Log in FOLLOW US * Twitter * Instagram * YouTube * LinkedIn * GitHub