WebsiteTemplate/cheatsheets/htop.html
2026-01-25 11:33:37 -04:00

198 lines
6.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; font-src 'self' data:; img-src 'self' data:; connect-src 'self'; base-uri 'self'; form-action 'self' https://defcon.social https://bsky.app;">
<meta http-equiv="X-Content-Type-Options" content="nosniff">
<link rel="stylesheet" href="../assets/css/style.css">
<link rel="icon" type="image/x-icon" href="../favicon.ico">
<script>
// Apply theme immediately to prevent flash
(function() {
const theme = localStorage.getItem('theme') ||
(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
document.documentElement.setAttribute('data-theme', theme);
})();
</script>
<title>htop Cheatsheet - Cheatsheets - Launch Pad</title>
</head>
<body>
<button class="theme-toggle" id="themeToggle" aria-label="Toggle dark mode">
<svg class="theme-icon theme-icon-moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
<svg class="theme-icon theme-icon-sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: none;"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
</button>
<br/><br/>
<div class="name">
__ _______________________ _________._________________________
\_ _____/ \______ \ / _ \ / _____/ / _____/ | | \_ _____/
| __) | _/ / /_\ \ / \ ___ / \ ___ | | | __)_
| \ | | \ / | \ \ \_\ \ \ \_\ \ | |___ | \
\___ / |____|_ / \____|__ / \______ / \______ / |_______ \ /_______ /
\/ \/ \/ \/ \/ \/ \/
</div>
<div class="blog-page-header">
<div class="blog-header-content">
<a href="/cheatsheets" class="back-link" title="Back to Cheatsheets">
<svg xmlns="http://www.w3.org/2000/svg" width="42" height="42" viewBox="0 0 24 24" class="home-icon"><path fill="currentColor" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>
</a>
<h1 class="blog-page-title">htop Cheatsheet</h1>
</div>
</div>
<div class="blog-post-container">
<div class="blog-posts-container" style="max-width: 900px; margin: 0 auto;">
<div class="blog-post">
<div class="blog-post-content">
<p><a href="index.html">← Back to cheatsheets</a></p>
<p><a href="../index.html">← Home</a></p>
<hr>
<p>htop is an interactive process viewer and system monitor. Enhanced version of top with better visualization, mouse support, and easier navigation.</p>
<hr>
<h2>Basic Usage</h2>
<ul>
<li>htop - Start interactive monitor</li>
</ul>
<ul>
<li>htop -u user - Show only user processes</li>
</ul>
<ul>
<li>htop -p PID1,PID2 - Monitor specific PIDs</li>
</ul>
<ul>
<li>htop -s column - Sort by column</li>
</ul>
<hr>
<h2>Interactive Keys</h2>
<ul>
<li>F1 - Help</li>
</ul>
<ul>
<li>F2 - Setup (configure display)</li>
</ul>
<ul>
<li>F3 - Search process</li>
</ul>
<ul>
<li>F4 - Filter processes</li>
</ul>
<ul>
<li>F5 - Tree view</li>
</ul>
<ul>
<li>F6 - Sort by column</li>
</ul>
<ul>
<li>F7 - Decrease nice (higher priority)</li>
</ul>
<ul>
<li>F8 - Increase nice (lower priority)</li>
</ul>
<ul>
<li>F9 - Kill process</li>
</ul>
<ul>
<li>F10 - Quit</li>
</ul>
<ul>
<li>Space - Tag process</li>
</ul>
<ul>
<li>u - Show processes of specific user</li>
</ul>
<ul>
<li>t - Tree/List view toggle</li>
</ul>
<ul>
<li>H - Show/hide threads</li>
</ul>
<ul>
<li>K - Show/hide kernel threads</li>
</ul>
<ul>
<li>P - Sort by CPU</li>
</ul>
<ul>
<li>M - Sort by memory</li>
</ul>
<ul>
<li>T - Sort by time</li>
</ul>
<ul>
<li>/ - Search</li>
</ul>
<ul>
<li>\ - Filter</li>
</ul>
<hr>
<h2>Command Line Options</h2>
<ul>
<li>-d delay - Update delay in seconds</li>
</ul>
<ul>
<li>-u user - Show only user processes</li>
</ul>
<ul>
<li>-p PID - Show only specific PIDs</li>
</ul>
<ul>
<li>-s column - Sort by column</li>
</ul>
<ul>
<li>-C - No color</li>
</ul>
<ul>
<li>-t - Tree view by default</li>
</ul>
<hr>
<h2>Common Examples</h2>
<h3>Basic Monitor</h3>
<pre><code>htop</code></pre>
<p>Start interactive monitor.</p>
<h3>User Processes</h3>
<pre><code>htop -u username</code></pre>
<p>Show only specific user.</p>
<h3>Sort by Memory</h3>
<pre><code>htop -s PERCENT_MEM</code></pre>
<p>Start sorted by memory usage.</p>
<h3>Tree View</h3>
<pre><code>htop -t</code></pre>
<p>Start in tree view.</p>
<h3>Specific PIDs</h3>
<pre><code>htop -p 1234,5678</code></pre>
<p>Monitor specific processes.</p>
<hr>
<h2>Tips</h2>
<ul>
<li>Use F6 to change sort column</li>
</ul>
<ul>
<li>Use F4 to filter processes</li>
</ul>
<ul>
<li>Use F5 for tree view to see process hierarchy</li>
</ul>
<ul>
<li>Use F9 to kill processes</li>
</ul>
<ul>
<li>Use F7/F8 to adjust process priority</li>
</ul>
<ul>
<li>Much more user-friendly than top</li>
</ul>
<ul>
<li>Supports mouse interaction</li>
</ul>
<ul>
<li>Essential for system monitoring</li>
</ul>
</div>
</div>
</div>
</div>
<script async type="text/javascript" src="../blog/analytics.js"></script>
<script src="../theme.js"></script>
</body>
</html>