<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nima jahan bakhshian</title>
    <description>The latest articles on DEV Community by Nima jahan bakhshian (@dvlpr1996).</description>
    <link>https://dev.to/dvlpr1996</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2620104%2F3f0ef5ef-ec81-4188-9707-cfd9a55f817f.jpg</url>
      <title>DEV Community: Nima jahan bakhshian</title>
      <link>https://dev.to/dvlpr1996</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dvlpr1996"/>
    <language>en</language>
    <item>
      <title>PHP CLI SAPI</title>
      <dc:creator>Nima jahan bakhshian</dc:creator>
      <pubDate>Sun, 11 Oct 2026 22:35:27 +0000</pubDate>
      <link>https://dev.to/dvlpr1996/php-cli-sapi-lel</link>
      <guid>https://dev.to/dvlpr1996/php-cli-sapi-lel</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;PHP is a general-purpose scripting language mainly known for web development.&lt;br&gt;
However, PHP code does not run on its own. The Zend Engine compiles and&lt;br&gt;
executes code, yet it still needs a host layer that feeds it the script, collects the output, and describes the environment. That layer is called a SAPI (Server Application Programming Interface).&lt;/p&gt;

&lt;p&gt;PHP can run in different environments, and each one has its own SAPI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;cli&lt;/code&gt; -&amp;gt; Command line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fpm-fcgi&lt;/code&gt; -&amp;gt; PHP-FPM (FastCGI Process Manager)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cgi-fcgi&lt;/code&gt; -&amp;gt; CGI / FastCGI&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apache2handler&lt;/code&gt; -&amp;gt; Apache module&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;embed&lt;/code&gt; -&amp;gt; PHP embedded in another C program&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;phpdbg&lt;/code&gt; -&amp;gt; The interactive debugger&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cli-server&lt;/code&gt; -&amp;gt; PHP's built-in development server&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This post focuses on the &lt;strong&gt;CLI SAPI&lt;/strong&gt;, which lets you runs PHP scripts directly from the terminal without a web server.&lt;br&gt;
The PHP command line interface (CLI) is a powerful tool for developers, and mastering it can significantly enhance your productivity.&lt;/p&gt;
&lt;h2&gt;
  
  
  What Makes The Cli Sapi Different
&lt;/h2&gt;

&lt;p&gt;First, there’s no web server, so there’s no HTTP request.&lt;/p&gt;

&lt;p&gt;Arguments arrive in $argv (the script name is at index 0) and $argc. STDIN, STDOUT and STDERR are already defined as stream constants.&lt;/p&gt;

&lt;p&gt;A few INI defaults are overridden because the usual web settings don’t make sense in a terminal. CLI also looks for php-cli.ini before php.ini, which is why CLI and FPM often end up with different configurations.&lt;/p&gt;

&lt;p&gt;The working directory is not changed to the script's directory. Relative paths resolve against where you launched the process, so use &lt;code&gt;__DIR__&lt;/code&gt; for paths relative to the script.&lt;/p&gt;

&lt;p&gt;Exit codes also matter because shells, cron and CI act on them. &lt;code&gt;exit(n)&lt;/code&gt; returns &lt;code&gt;n&lt;/code&gt; to the shell, &lt;code&gt;exit("message")&lt;/code&gt; prints the message and returns 0, and an uncaught fatal error returns 255.&lt;/p&gt;
&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;When you invoke PHP from the command line, the &lt;strong&gt;CLI SAPI&lt;/strong&gt; starts the Zend Engine, loads configuration from &lt;code&gt;php.ini&lt;/code&gt; or command-line overrides, processes the arguments, and runs the given script or code.&lt;/p&gt;
&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;CLI SAPI&lt;/strong&gt; is useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run scripts without a web server&lt;/li&gt;
&lt;li&gt;Test code snippets quickly&lt;/li&gt;
&lt;li&gt;Automate routine tasks

&lt;ul&gt;
&lt;li&gt;Database migrations and data imports&lt;/li&gt;
&lt;li&gt;Report generation and log processing&lt;/li&gt;
&lt;li&gt;Cleanup and maintenance jobs&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Debug applications (with &lt;code&gt;phpdbg&lt;/code&gt; or &lt;code&gt;Xdebug&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Administer servers (deployment and maintenance scripts)&lt;/li&gt;
&lt;li&gt;Use an interactive shell (REPL)&lt;/li&gt;
&lt;li&gt;Manage dependencies (e.g., Composer)&lt;/li&gt;
&lt;li&gt;Run framework commands and a development server&lt;/li&gt;
&lt;li&gt;Inspect and override INI settings&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Common Commands From The Terminal
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Interactive Shell&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="c"&gt;# starts an interactive php shell (REPL)&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-a&lt;/span&gt;
php &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;echo &lt;/span&gt;password_hash&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"pass"&lt;/span&gt;, PASSWORD_DEFAULT&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Syntax Check (Lint)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-l&lt;/span&gt; &amp;lt;file&amp;gt; &lt;span class="c"&gt;# checks a php file for syntax errors without executing it&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-l&lt;/span&gt; script.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Built-in Development Server&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-S&lt;/span&gt; &amp;lt;address&amp;gt;:&amp;lt;port&amp;gt; &lt;span class="c"&gt;# starts php’s built-in web server&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-S&lt;/span&gt; localhost:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Execute a PHP File&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-f&lt;/span&gt; &amp;lt;file&amp;gt; &lt;span class="c"&gt;# executes a php file&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-f&lt;/span&gt; migrate.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Run PHP Code Directly&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-r&lt;/span&gt; &amp;lt;code&amp;gt; &lt;span class="c"&gt;# runs php code without creating a file&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'echo bin2hex(random_bytes(16));'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Show PHP Version&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="c"&gt;# displays the current php version&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Show Full PHP Information&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="c"&gt;# displays detailed php configuration&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-i&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"Loaded Configuration File"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Show Loaded Modules&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="c"&gt;# lists all compiled and loaded php modules&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-m&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; redis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Define / Override INI Setting&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;setting&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;value &lt;span class="c"&gt;# temporarily sets or overrides a php configuration value&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;memory_limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1G &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;max_execution_time&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 import-data.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Set Document Root for Built-in server&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-S&lt;/span&gt; &amp;lt;address&amp;gt;:&amp;lt;port&amp;gt; &lt;span class="nt"&gt;-t&lt;/span&gt; &amp;lt;docroot&amp;gt; &lt;span class="c"&gt;# starts the built-in server with a specific document root&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-S&lt;/span&gt; 0.0.0.0:8000 &lt;span class="nt"&gt;-t&lt;/span&gt; public
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Show Loaded INI Files&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;--ini&lt;/span&gt; &lt;span class="c"&gt;# shows which php.ini and scanned .ini files are loaded&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;--ini&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Reflection Information&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;--ri&lt;/span&gt; &amp;lt;extension&amp;gt; &lt;span class="c"&gt;# shows the configuration of one extension&lt;/span&gt;
php &lt;span class="nt"&gt;--rf&lt;/span&gt; &amp;lt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="c"&gt;# shows reflection info for a function&lt;/span&gt;
php &lt;span class="nt"&gt;--rc&lt;/span&gt; &amp;lt;class&amp;gt; &lt;span class="c"&gt;# shows reflection info for a class&lt;/span&gt;
php &lt;span class="nt"&gt;--re&lt;/span&gt; &amp;lt;extension&amp;gt; &lt;span class="c"&gt;# shows everything an extension provides&lt;/span&gt;

&lt;span class="c"&gt;# Examples&lt;/span&gt;
php &lt;span class="nt"&gt;--ri&lt;/span&gt; pdo_mysql
php &lt;span class="nt"&gt;--rf&lt;/span&gt; array_map
php &lt;span class="nt"&gt;--rc&lt;/span&gt; DateTime
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Use a Router Script with the Built-in Server&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-S&lt;/span&gt; &amp;lt;address&amp;gt;:&amp;lt;port&amp;gt; &amp;lt;router&amp;gt; &lt;span class="c"&gt;# sends every request through a router script&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-S&lt;/span&gt; localhost:8000 &lt;span class="nt"&gt;-t&lt;/span&gt; public public/index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Strip Comments and Whitespace&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-w&lt;/span&gt; &amp;lt;file&amp;gt; &lt;span class="c"&gt;# prints the source with comments and whitespace removed&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-w&lt;/span&gt; foo.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Show Help&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="c"&gt;# lists all available command-line options&lt;/span&gt;

&lt;span class="c"&gt;# Example&lt;/span&gt;
php &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;








&lt;blockquote&gt;
&lt;p&gt;“I’m not a real programmer. I throw together things until it works then I move on. The real programmers will say Yeah it works but you’re leaking memory everywhere. Perhaps we should fix that. I’ll just restart Apache every 10 requests.”&lt;/p&gt;

&lt;p&gt;— Rasmus Lerdorf&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>php</category>
      <category>programming</category>
      <category>webdev</category>
      <category>cli</category>
    </item>
    <item>
      <title>Movies and Series Every Programmer Should Watch</title>
      <dc:creator>Nima jahan bakhshian</dc:creator>
      <pubDate>Thu, 01 Oct 2026 21:21:08 +0000</pubDate>
      <link>https://dev.to/dvlpr1996/movies-and-series-every-programmer-should-watch-3jch</link>
      <guid>https://dev.to/dvlpr1996/movies-and-series-every-programmer-should-watch-3jch</guid>
      <description>&lt;h3&gt;
  
  
  1. &lt;a href="https://www.imdb.com/title/tt4158110/" rel="noopener noreferrer"&gt;Mr. Robot&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;2015–2019 — &lt;code&gt;Series&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 8.5/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 94%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Drama, Crime, Cybersecurity&lt;/p&gt;

&lt;p&gt;Mr. Robot follows Elliot Alderson, a cybersecurity engineer and hacker who becomes involved with a group attempting to bring down a powerful corporation. The series focuses heavily on hacking, Linux, cybersecurity, privacy, social engineering, cryptography, networking, and digital infrastructure.&lt;/p&gt;

&lt;h5&gt;
  
  
  Why programmers should watch it?
&lt;/h5&gt;

&lt;p&gt;Shows a serious representation of cybersecurity and hacking.&lt;br&gt;
Introduces concepts such as Linux, networking, encryption, social engineering, and system vulnerabilities.&lt;br&gt;
Demonstrates the importance of understanding how systems actually work rather than simply using frameworks and APIs.&lt;br&gt;
Shows the relationship between technology, corporations, privacy, and society.&lt;br&gt;
Encourages a security-oriented mindset: "What assumptions does this system make, and how could they fail?"&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;Don't just learn how to use a system. Learn how the system works underneath.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;a href="https://www.imdb.com/title/tt2575988/" rel="noopener noreferrer"&gt;Silicon Valley&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;2014–2019 — &lt;code&gt;Series&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 8.5/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 94%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Comedy, Sitcom&lt;/p&gt;

&lt;p&gt;Silicon Valley follows Richard Hendricks, a programmer who develops a potentially revolutionary technology and attempts to build a company around it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Shows software startup culture.&lt;br&gt;
Demonstrates the difference between writing software and building a software company.&lt;br&gt;
Covers technical debt, scalability, architecture, funding, investors, hiring, founders, acquisitions, and product development.&lt;br&gt;
Shows how programmers communicate with business people and investors.&lt;br&gt;
Provides an entertaining representation of engineering-team dynamics.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;Great code is important, but software engineering exists inside a larger product and business ecosystem.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;a href="https://www.imdb.com/title/tt1285016/" rel="noopener noreferrer"&gt;The Social Network&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;2010 — &lt;code&gt;Movie&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 7.8/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 96%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Biography, Drama&lt;/p&gt;

&lt;p&gt;The movie dramatizes the creation and early growth of Facebook and the conflicts surrounding its founders and business relationships.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Shows how a relatively simple software idea can become a massive product.&lt;br&gt;
Demonstrates the importance of speed and execution.&lt;br&gt;
Introduces product-market fit and competition.&lt;br&gt;
Shows the relationship between programmers, founders, investors, and business.&lt;br&gt;
Raises questions about intellectual property and ownership.&lt;br&gt;
Demonstrates that technical ability alone does not determine the success of a product.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;Don't only ask "How do I build this?" Ask "Why are we building this, and who needs it?"&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;a href="https://www.imdb.com/title/tt2543312/" rel="noopener noreferrer"&gt;Halt and Catch Fire&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;2014–2017 — &lt;code&gt;Series&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 8.4/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 90%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Drama&lt;/p&gt;

&lt;p&gt;The series follows engineers, entrepreneurs, and programmers during the evolution of the personal-computer and early Internet industries.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Gives you perspective on the history of computing.&lt;br&gt;
Shows hardware and software development.&lt;br&gt;
Explores operating systems, reverse engineering, networking, and early Internet technologies.&lt;br&gt;
Demonstrates how technological innovation actually happens.&lt;br&gt;
Shows engineering teams dealing with technical and interpersonal problems.&lt;br&gt;
Helps you understand that today's technology stack was built over decades.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;Every technology you use today is built on decades of previous engineering decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. &lt;a href="https://www.imdb.com/title/tt2084970/" rel="noopener noreferrer"&gt;The Imitation Game&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;2014 — &lt;code&gt;Movie&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 8.0/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 90%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Biography, Drama, War&lt;/p&gt;

&lt;p&gt;The movie dramatizes Alan Turing's work during World War II and the effort to break the German Enigma encryption system.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Introduces cryptography.&lt;br&gt;
Demonstrates algorithmic thinking.&lt;br&gt;
Shows computational problem solving.&lt;br&gt;
Demonstrates how difficult problems can require completely new approaches.&lt;br&gt;
Shows the importance of abstraction and automation.&lt;br&gt;
Provides historical context for the development of computing.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;When a problem seems impossible, changing the way you represent the problem can be more powerful than simply working harder.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. &lt;a href="https://www.imdb.com/title/tt0168122/" rel="noopener noreferrer"&gt;Pirates of Silicon Valley&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;1999 — &lt;code&gt;Movie / TV Movie&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 7.2/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 89%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Biography, Drama&lt;/p&gt;

&lt;p&gt;The movie dramatizes the early history of Apple and Microsoft and the rivalry between Steve Jobs and Bill Gates.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Introduces the early history of personal computing.&lt;br&gt;
Shows how software and hardware companies evolved.&lt;br&gt;
Demonstrates competition in the technology industry.&lt;br&gt;
Shows how business strategy can be as important as technology.&lt;br&gt;
Helps explain the origins of companies that shaped modern computing.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;Technology becomes powerful when engineering, business, distribution, and timing come together.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. &lt;a href="https://www.imdb.com/title/tt8134186/" rel="noopener noreferrer"&gt;Devs&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;2020 — &lt;code&gt;Series&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 7.6/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 82%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Sci-Fi, Drama, Mystery&lt;/p&gt;

&lt;p&gt;Devs follows a software engineer who investigates a secret technology project at a powerful technology company. The series explores computing, algorithms, determinism, artificial intelligence, and the possibility of predicting reality.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Explores the philosophical limits of computation.&lt;br&gt;
Raises questions about algorithms and prediction.&lt;br&gt;
Discusses artificial intelligence and advanced computing.&lt;br&gt;
Makes you think about determinism and free will.&lt;br&gt;
Demonstrates that software engineering can involve philosophical questions, not only technical ones.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;Powerful computational systems force us to ask what computation can actually know, predict, and control.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. &lt;a href="https://www.imdb.com/title/tt0133093/" rel="noopener noreferrer"&gt;The Matrix&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;1999 — &lt;code&gt;Movie&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 8.7/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅⭐83%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Action, Sci-Fi&lt;/p&gt;

&lt;p&gt;A computer hacker discovers that the reality he experiences is actually a sophisticated simulation controlled by machines.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Explores abstraction and simulated environments.&lt;br&gt;
Raises questions about information and reality.&lt;br&gt;
Encourages you to question assumptions.&lt;br&gt;
Provides an interesting metaphor for systems and software abstractions.&lt;br&gt;
Demonstrates how a system can hide its underlying implementation.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;The abstraction you interact with is not necessarily the underlying reality.&lt;/p&gt;

&lt;p&gt;For programmers, this is particularly relevant because almost every layer of software is an abstraction over another layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  9. &lt;a href="https://www.imdb.com/title/tt0470752/" rel="noopener noreferrer"&gt;Ex Machina&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;2014 — &lt;code&gt;Movie&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 7.7/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 82%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Sci-Fi, Drama, Thriller&lt;/p&gt;

&lt;p&gt;A programmer is invited to a private facility to participate in an experiment involving an advanced artificial intelligence embodied in a humanoid robot.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Explores artificial intelligence.&lt;br&gt;
Raises questions about machine consciousness.&lt;br&gt;
Discusses AI behavior and human-machine interaction.&lt;br&gt;
Examines privacy and data collection.&lt;br&gt;
Raises questions about the responsibility of people who create powerful systems.&lt;br&gt;
Demonstrates why technical capability and ethical considerations cannot always be separated.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;The fact that we can build something does not automatically answer whether we understand its consequences.&lt;/p&gt;

&lt;h3&gt;
  
  
  10. &lt;a href="https://www.imdb.com/title/tt0113243/" rel="noopener noreferrer"&gt;Hackers&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;1995 — &lt;code&gt;Movie&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 6.2/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 34%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Crime, Thriller, Drama&lt;/p&gt;

&lt;p&gt;Hackers follows a group of young computer hackers who become involved in a conspiracy involving a computer virus and corporate crime.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Captures the hacker culture of the 1990s.&lt;br&gt;
Provides historical context for early Internet culture.&lt;br&gt;
Shows how popular culture viewed hackers before modern cybersecurity became mainstream.&lt;br&gt;
Introduces ideas around networks, passwords, viruses, social engineering, and digital identity.&lt;br&gt;
Helps you appreciate how dramatically computing culture has changed.&lt;/p&gt;

&lt;p&gt;Important:&lt;br&gt;
The technical aspects are highly stylized and should not be considered an accurate cybersecurity tutorial.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;Technology changes quickly, but hacker culture and curiosity about systems have deep roots.&lt;/p&gt;

&lt;h3&gt;
  
  
  11. &lt;a href="https://www.imdb.com/title/tt0487831/" rel="noopener noreferrer"&gt;The IT Crowd&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;2006–2013 — &lt;code&gt;Series&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 8.5/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 85%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Comedy, Sitcom&lt;/p&gt;

&lt;p&gt;A comedy centered around Roy, Moss, and Jen, who work in the IT department of a large corporation.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Shows the funny side of working in IT.&lt;br&gt;
Illustrates common misunderstandings between technical and non-technical employees.&lt;br&gt;
Shows help-desk and IT-support culture.&lt;br&gt;
Demonstrates the importance of communication.&lt;br&gt;
Makes fun of unrealistic expectations placed on technical teams.&lt;br&gt;
Reminds programmers that software engineering is ultimately a human profession.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;Technical knowledge is only part of being a good engineer. Communication matters too.&lt;/p&gt;

&lt;h3&gt;
  
  
  12. &lt;a href="https://www.imdb.com/title/tt0105435/" rel="noopener noreferrer"&gt;Sneakers&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;1992 — &lt;code&gt;Movie&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IMDb:&lt;/code&gt; ⭐ 7.1/10&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Rotten Tomatoes:&lt;/code&gt; 🍅 80%&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Genre:&lt;/code&gt; Crime, Comedy, Thriller&lt;/p&gt;

&lt;p&gt;A team of security experts is hired to test organizations' security systems but becomes involved in a much larger operation involving cryptography and information security.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why programmers should watch it?
&lt;/h4&gt;

&lt;p&gt;Explores information security.&lt;br&gt;
Introduces cryptography concepts.&lt;br&gt;
Demonstrates social engineering.&lt;br&gt;
Shows penetration testing from a historical perspective.&lt;br&gt;
Explores the importance of information and access.&lt;br&gt;
Demonstrates that security is not purely a technical problem.&lt;/p&gt;

&lt;p&gt;Key lesson:&lt;/p&gt;

&lt;p&gt;Security is a system involving technology, people, processes, and information—not merely passwords and firewalls.&lt;/p&gt;

&lt;h3&gt;
  
  
  I Recommend Watching Them In This Order
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Mr. Robot&lt;/li&gt;
&lt;li&gt;Silicon Valley&lt;/li&gt;
&lt;li&gt;Halt and Catch Fire&lt;/li&gt;
&lt;li&gt;The Social Network&lt;/li&gt;
&lt;li&gt;The Imitation Game&lt;/li&gt;
&lt;li&gt;Pirates of Silicon Valley&lt;/li&gt;
&lt;li&gt;Hackers&lt;/li&gt;
&lt;li&gt;Sneakers&lt;/li&gt;
&lt;li&gt;The IT Crowd&lt;/li&gt;
&lt;li&gt;Ex Machina&lt;/li&gt;
&lt;li&gt;Devs&lt;/li&gt;
&lt;li&gt;The Matrix&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What Engineering Principle Is This Story Trying To Demonstrate?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Mr. Robot → Security mindset&lt;/li&gt;
&lt;li&gt;Silicon Valley → Software + business&lt;/li&gt;
&lt;li&gt;Halt and Catch Fire → Innovation&lt;/li&gt;
&lt;li&gt;The Social Network → Product + execution&lt;/li&gt;
&lt;li&gt;The Imitation Game → Algorithms + problem solving&lt;/li&gt;
&lt;li&gt;Pirates of Silicon Valley → Technology + competition&lt;/li&gt;
&lt;li&gt;Devs → Computation + philosophy&lt;/li&gt;
&lt;li&gt;The Matrix → Abstraction + systems&lt;/li&gt;
&lt;li&gt;Ex Machina → AI + ethics&lt;/li&gt;
&lt;li&gt;Hackers → Hacker culture&lt;/li&gt;
&lt;li&gt;The IT Crowd → Communication + IT culture&lt;/li&gt;
&lt;li&gt;Sneakers → Security + social engineering&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programmer</category>
      <category>movies</category>
      <category>series</category>
    </item>
    <item>
      <title>Linux common commands every developer should know</title>
      <dc:creator>Nima jahan bakhshian</dc:creator>
      <pubDate>Sat, 12 Sep 2026 22:03:58 +0000</pubDate>
      <link>https://dev.to/dvlpr1996/linux-common-commands-every-developer-should-know-4l2o</link>
      <guid>https://dev.to/dvlpr1996/linux-common-commands-every-developer-should-know-4l2o</guid>
      <description>&lt;p&gt;The command line is one of the most powerful and efficient ways to interact with Linux systems. For developers, knowing the commands can make tasks much faster and easier.&lt;br&gt;
This article provides a reference of useful Linux commands for developers. this commands are organized by category so you can be easily found and used when needed.&lt;/p&gt;


&lt;h3&gt;
  
  
  Navigation and directory management
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;ls -&amp;gt; List directory contents&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="c"&gt;# long format (permissions, size, date)&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; &lt;span class="c"&gt;# include hidden files&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-lh&lt;/span&gt; &lt;span class="c"&gt;# human-readable sizes&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-lt&lt;/span&gt; &lt;span class="c"&gt;# sort by modification time&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; &lt;span class="c"&gt;# recursive listing&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;cd -&amp;gt; Change directory&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /absolute/path
&lt;span class="nb"&gt;cd&lt;/span&gt; .. &lt;span class="c"&gt;# go up one level&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; - &lt;span class="c"&gt;# switch to previous directory&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; ~ or just &lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="c"&gt;# go to home directory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;pwd -&amp;gt; Print working directory&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;mkdir -&amp;gt; Create directories&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &amp;lt;dir_name&amp;gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; path/to/nested/dir &lt;span class="c"&gt;# create parent directories if needed&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; 755 new_dir &lt;span class="c"&gt;# set permissions while creating&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  File operations
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;rm&lt;/code&gt; -&amp;gt; Remove files/directories&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm &lt;/span&gt;file.txt
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; directory/ &lt;span class="c"&gt;# recursive delete&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; directory/ &lt;span class="c"&gt;# force recursive (dangerous!)&lt;/span&gt;
&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; file &lt;span class="c"&gt;# interactive confirmation&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;cp&lt;/code&gt; -&amp;gt; Copy files/directories&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp &lt;/span&gt;file1 file2
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt;/ dest/ &lt;span class="c"&gt;# recursive copy&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nb"&gt;source&lt;/span&gt;/ dest/ &lt;span class="c"&gt;# archive mode (preserve attributes)&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; file dest/ &lt;span class="c"&gt;# verbose output&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;mv&lt;/code&gt; -&amp;gt; Move or rename&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mv &lt;/span&gt;old_name new_name
&lt;span class="nb"&gt;mv &lt;/span&gt;file /path/to/destination/
&lt;span class="nb"&gt;mv&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; file dest/ &lt;span class="c"&gt;# interactive (ask before overwrite)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Viewing searching content
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;cat&lt;/code&gt; -&amp;gt; Display or create files&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;file.txt
&lt;span class="nb"&gt;cat &lt;/span&gt;file1 file2 &lt;span class="c"&gt;# concatenate multiple files&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; newfile.txt &lt;span class="c"&gt;# create/overwrite a file&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; file.txt &lt;span class="c"&gt;# append to a file&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; file.txt &lt;span class="c"&gt;# show line numbers&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;grep&lt;/code&gt; -&amp;gt; Search text patterns&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"pattern"&lt;/span&gt; file.txt
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s2"&gt;"pattern"&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="c"&gt;# recursive search&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"pattern"&lt;/span&gt; file &lt;span class="c"&gt;# case-insensitive&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"pattern"&lt;/span&gt; file &lt;span class="c"&gt;# show line numbers&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"pattern"&lt;/span&gt; file &lt;span class="c"&gt;# invert match (exclude)&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s2"&gt;"regex"&lt;/span&gt; file &lt;span class="c"&gt;# extended regex&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;find&lt;/code&gt; -&amp;gt; Locate files and directories&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.js"&lt;/span&gt;
find /path &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.log"&lt;/span&gt; &lt;span class="c"&gt;# only files&lt;/span&gt;
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-mtime&lt;/span&gt; &lt;span class="nt"&gt;-7&lt;/span&gt; &lt;span class="c"&gt;# modified in last 7 days&lt;/span&gt;
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-size&lt;/span&gt; +10M &lt;span class="c"&gt;# files larger than 10MB&lt;/span&gt;
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s2"&gt;"*.tmp"&lt;/span&gt; &lt;span class="nt"&gt;-delete&lt;/span&gt; &lt;span class="c"&gt;# find and delete&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Permissions
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;chmod&lt;/code&gt; -&amp;gt; Change file permissions&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod &lt;/span&gt;755 script.sh &lt;span class="c"&gt;# rwxr-xr-x&lt;/span&gt;
&lt;span class="nb"&gt;chmod&lt;/span&gt; +x script.sh &lt;span class="c"&gt;# add execute permission&lt;/span&gt;
&lt;span class="nb"&gt;chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 644 directory/ &lt;span class="c"&gt;# recursive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Process management
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;ps&lt;/code&gt; -&amp;gt; List running processes&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux &lt;span class="c"&gt;# all processes with details&lt;/span&gt;
ps &lt;span class="nt"&gt;-ef&lt;/span&gt; &lt;span class="c"&gt;# full format listing&lt;/span&gt;
ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;node &lt;span class="c"&gt;# filter specific process&lt;/span&gt;
ps &lt;span class="nt"&gt;-u&lt;/span&gt; username &lt;span class="c"&gt;# processes of a specific user&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;kill / killall&lt;/code&gt; -&amp;gt; Terminate processes&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;kill &lt;/span&gt;PID &lt;span class="c"&gt;# graceful termination (SIGTERM)&lt;/span&gt;
&lt;span class="nb"&gt;kill&lt;/span&gt; &lt;span class="nt"&gt;-9&lt;/span&gt; PID &lt;span class="c"&gt;# force kill (SIGKILL)&lt;/span&gt;
killall process_name &lt;span class="c"&gt;# kill by name&lt;/span&gt;
&lt;span class="nb"&gt;kill&lt;/span&gt; &lt;span class="nt"&gt;-15&lt;/span&gt; PID &lt;span class="c"&gt;# same as default SIGTERM&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Archiving
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;tar&lt;/code&gt; -&amp;gt; Archive and compress&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-czvf&lt;/span&gt; archive.tar.gz folder/ &lt;span class="c"&gt;# create gzip archive&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xzvf&lt;/span&gt; archive.tar.gz &lt;span class="c"&gt;# extract&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-tzvf&lt;/span&gt; archive.tar.gz &lt;span class="c"&gt;# list contents&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-cjvf&lt;/span&gt; archive.tar.bz2 folder/ &lt;span class="c"&gt;# bzip2 compression&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  System resource monitoring
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;df&lt;/code&gt; -&amp;gt; Display disk space usage&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="c"&gt;# human-readable sizes (GB/MB)&lt;/span&gt;
&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-hT&lt;/span&gt; &lt;span class="c"&gt;# show filesystem type&lt;/span&gt;
&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="c"&gt;# show inode usage&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;du&lt;/code&gt; -&amp;gt; Estimate file/directory space usage&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-sh&lt;/span&gt; folder/ &lt;span class="c"&gt;# total size of a folder (summary)&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="nt"&gt;--max-depth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="c"&gt;# size of each subfolder&lt;/span&gt;
&lt;span class="nb"&gt;du&lt;/span&gt; &lt;span class="nt"&gt;-ah&lt;/span&gt; &lt;span class="c"&gt;# show all files and directories&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;free&lt;/code&gt; -&amp;gt; Display memory usage&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;free &lt;span class="nt"&gt;-h&lt;/span&gt; &lt;span class="c"&gt;# human-readable&lt;/span&gt;
free &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="c"&gt;# show in megabytes&lt;/span&gt;
free &lt;span class="nt"&gt;-s&lt;/span&gt; 5 &lt;span class="c"&gt;# refresh every 5 seconds&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;uptime&lt;/code&gt; -&amp;gt; Show system uptime and load average&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;uptime&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="c"&gt;# pretty format (“up 2 days, 3 hours”)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;top&lt;/code&gt; -&amp;gt; Real-time overall system view&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;top &lt;span class="c"&gt;# interactive view&lt;/span&gt;
Press M &lt;span class="c"&gt;# sort by memory&lt;/span&gt;
Press P &lt;span class="c"&gt;# sort by CPU&lt;/span&gt;
Press q &lt;span class="c"&gt;# quit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;vmstat&lt;/code&gt; -&amp;gt; System memory, processes, CPU, I/O stats&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vmstat 1 &lt;span class="c"&gt;# update every 1 second&lt;/span&gt;
vmstat &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="c"&gt;# summary of memory statistics&lt;/span&gt;
vmstat &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="c"&gt;# disk statistics&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Process viewing
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;pstree&lt;/code&gt; -&amp;gt; Display processes in a tree structure&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pstree &lt;span class="c"&gt;# basic tree&lt;/span&gt;
pstree &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="c"&gt;# show PIDs&lt;/span&gt;
pstree &lt;span class="nt"&gt;-u&lt;/span&gt; &lt;span class="c"&gt;# show usernames&lt;/span&gt;
pstree &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="c"&gt;# show command-line arguments&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Command history
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;history&lt;/code&gt; -&amp;gt; View previously executed commands&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;history&lt;/span&gt; &lt;span class="c"&gt;# full list&lt;/span&gt;
&lt;span class="nb"&gt;history &lt;/span&gt;20 &lt;span class="c"&gt;# last 20 commands&lt;/span&gt;
&lt;span class="o"&gt;!&lt;/span&gt;123 &lt;span class="c"&gt;# re-run command number 123&lt;/span&gt;
&lt;span class="o"&gt;!!&lt;/span&gt; &lt;span class="c"&gt;# re-run the last command&lt;/span&gt;
&lt;span class="nb"&gt;history&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"docker"&lt;/span&gt; &lt;span class="c"&gt;# search past commands&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






</description>
      <category>linux</category>
      <category>command</category>
      <category>developer</category>
      <category>programming</category>
    </item>
    <item>
      <title>Practical Git Commands Every Developer Should Know</title>
      <dc:creator>Nima jahan bakhshian</dc:creator>
      <pubDate>Sun, 06 Sep 2026 08:31:15 +0000</pubDate>
      <link>https://dev.to/dvlpr1996/practical-git-commands-every-developer-should-know-3do7</link>
      <guid>https://dev.to/dvlpr1996/practical-git-commands-every-developer-should-know-3do7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff6q5hq64b67ml76c0pqv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff6q5hq64b67ml76c0pqv.jpg" alt="git commands" width="736" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Git is the most widely used version control system in the world. Whether you’re working alone or collaborating with a team, knowing the right commands can save you hours of frustration and help you work more confidently.&lt;/p&gt;

&lt;p&gt;Below is a practical collection of the most useful Git commands, organized by real-world workflows.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. Getting Started
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Creates a new Git repository in the current directory&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Downloads an existing repository from a remote server and creates a local copy&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone &amp;lt;repository-url&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Sets your identity so every commit is correctly attributed to you&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"your.email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Daily Workflow
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Check the current status of your working directory&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status &lt;span class="c"&gt;# shows which files are modified, staged, or untracked&lt;/span&gt;

git status &lt;span class="nt"&gt;-sb&lt;/span&gt; &lt;span class="c"&gt;# the shorter and cleaner version&lt;/span&gt;

git add &amp;lt;file&amp;gt; &lt;span class="c"&gt;# stage a specific file&lt;/span&gt;

git add &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="c"&gt;# stage all changes&lt;/span&gt;

&lt;span class="c"&gt;# Show unstaged changes (working directory vs staging area)&lt;/span&gt;
git diff

&lt;span class="c"&gt;# Show staged changes (staging area vs last commit)&lt;/span&gt;
git diff &lt;span class="nt"&gt;--staged&lt;/span&gt;

&lt;span class="c"&gt;# Create a commit&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"feat: add image uploader"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. Working with Branches
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Switching Branches with&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git switch&lt;/code&gt; is the dedicated command for switching branches (safer and clearer than the old &lt;code&gt;git checkout&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Switch to an existing branch&lt;/span&gt;
git switch feature-branch

&lt;span class="c"&gt;# Create a new branch and switch to it in one command&lt;/span&gt;
git switch &lt;span class="nt"&gt;-c&lt;/span&gt; new-feature

git branch &lt;span class="c"&gt;# List all local branches&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  4. Working with Remotes
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Managing Remotes&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Show remote repositories with their fetch and push URLs&lt;/span&gt;
git remote &lt;span class="nt"&gt;-v&lt;/span&gt;

&lt;span class="c"&gt;# List remote names only&lt;/span&gt;
git remote

&lt;span class="c"&gt;# Remove a remote&lt;/span&gt;
git remote remove origin

&lt;span class="c"&gt;# Add a new remote&lt;/span&gt;
git remote add origin &amp;lt;repository-url&amp;gt;

&lt;span class="c"&gt;# Remove a remote&lt;/span&gt;
git remote remove &amp;lt;name&amp;gt;

&lt;span class="c"&gt;# Fetch latest changes without merging&lt;/span&gt;
git fetch &lt;span class="nt"&gt;--all&lt;/span&gt; &lt;span class="nt"&gt;--prune&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  5. Hunting Down Bugs
&lt;/h3&gt;

&lt;p&gt;If a bug has appeared and you're not sure which commit introduced it, bisect uses binary search across your commit history&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start a binary search to find which commit introduced a bug&lt;/span&gt;
git bisect start

&lt;span class="c"&gt;# Mark the current commit as bad (contains the bug)&lt;/span&gt;
git bisect bad

&lt;span class="c"&gt;# Mark a known good commit (for example version v1.0)&lt;/span&gt;
git bisect good v1.0

&lt;span class="c"&gt;# used to end a Git bisection session, clean up the bisection state&lt;/span&gt;
&lt;span class="c"&gt;# and return your working directory to the commit you were on before you started&lt;/span&gt;
git bisect reset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  6. Undoing Changes
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cleaning Up Untracked Files&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Dry-run: show which untracked files would be deleted (safe preview)&lt;/span&gt;
git clean &lt;span class="nt"&gt;-n&lt;/span&gt;

&lt;span class="c"&gt;# Actually delete untracked files and directories&lt;/span&gt;
git clean &lt;span class="nt"&gt;-fd&lt;/span&gt;

&lt;span class="c"&gt;# Discard changes in a specific file&lt;/span&gt;
git restore &amp;lt;file&amp;gt;

&lt;span class="c"&gt;# Discard all local uncommitted changes (dangerous)&lt;/span&gt;
git restore &lt;span class="nb"&gt;.&lt;/span&gt;
git clean &lt;span class="nt"&gt;-fd&lt;/span&gt;

&lt;span class="c"&gt;# Undo the last commit but keep the changes staged&lt;/span&gt;
git reset &lt;span class="nt"&gt;--soft&lt;/span&gt; HEAD~1

&lt;span class="c"&gt;# Undo the last commit and unstage the changes&lt;/span&gt;
git reset HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  7. Temporarily Saving Work (Stash)
&lt;/h3&gt;

&lt;p&gt;Always give a meaningful message with git stash push -m "...".&lt;/p&gt;

&lt;p&gt;After a few days stash@{0}, stash@{1} become completely useless without messages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Temporarily save (stash) your uncommitted changes so you can work on something else&lt;/span&gt;
git stash

&lt;span class="c"&gt;# Save your current uncommitted work (both staged + unstaged) with a clear message&lt;/span&gt;
&lt;span class="c"&gt;# Very useful when you need to urgently switch branch or pull latest changes&lt;/span&gt;
git stash push &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"WIP: login form validation and dark mode toggle"&lt;/span&gt;

&lt;span class="c"&gt;# Apply the most recent stash and remove it from the stash list&lt;/span&gt;
git stash pop

&lt;span class="c"&gt;# List all saved stashes&lt;/span&gt;
git stash list

&lt;span class="c"&gt;# Apply a specific stash (without removing it from the list)&lt;/span&gt;
git stash apply stash@&lt;span class="o"&gt;{&lt;/span&gt;2&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# See what is inside a particular stash&lt;/span&gt;
git stash show &lt;span class="nt"&gt;-p&lt;/span&gt; stash@&lt;span class="o"&gt;{&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# Delete a specific stash after you're done with it&lt;/span&gt;
git stash drop stash@&lt;span class="o"&gt;{&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# Delete ALL stashes (use carefully)&lt;/span&gt;
git stash clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  8. Attaching Notes to Commits
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;git notes&lt;/code&gt; lets you attach extra information to a commit, without changing the commit itself or its hash&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git notes add &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"This commit caused a regression in v2.3"&lt;/span&gt; &amp;lt;commit-hash&amp;gt;
git log &lt;span class="nt"&gt;--show-notes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  9. A Clean Summary of Contributors
&lt;/h3&gt;

&lt;p&gt;Instead of scrolling through a full commit log, &lt;code&gt;shortlog&lt;/code&gt; gives you a ranked summary of who committed what, and how often a quick way to generate a contribution report without external tooling.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git shortlog
git shortlog &lt;span class="nt"&gt;-sn&lt;/span&gt; &lt;span class="nt"&gt;--all&lt;/span&gt;
git shortlog &lt;span class="nt"&gt;-sn&lt;/span&gt; &lt;span class="nt"&gt;--since&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"1 month ago"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  10. Inspect Any Single Commit in Detail
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Show the full details of a specific commit (message, author, date, and the full diff of changes)&lt;/span&gt;
git show &amp;lt;commit-hash&amp;gt;

&lt;span class="c"&gt;# Show the content of a specific file as it existed in a particular commit&lt;/span&gt;
git show &amp;lt;commit-hash&amp;gt;:path/to/file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Happy coding, and may your commits always be meaningful!&lt;/p&gt;

</description>
      <category>git</category>
      <category>developer</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
