<?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: Shiva Charan</title>
    <description>The latest articles on DEV Community by Shiva Charan (@itsmecharan7).</description>
    <link>https://dev.to/itsmecharan7</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2636107%2F166cee69-0b74-4702-8518-8d850a3ff0c6.png</url>
      <title>DEV Community: Shiva Charan</title>
      <link>https://dev.to/itsmecharan7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/itsmecharan7"/>
    <language>en</language>
    <item>
      <title>Root Directory in Linux</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Tue, 12 May 2026 16:42:03 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/root-directory-in-linux-3hm9</link>
      <guid>https://dev.to/itsmecharan7/root-directory-in-linux-3hm9</guid>
      <description>&lt;h1&gt;
  
  
  Root Directory
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;In simple terms, the &lt;strong&gt;Root Directory&lt;/strong&gt; is the starting point for every single file and folder on a Linux system. It is represented by a single forward slash (&lt;strong&gt;&lt;code&gt;/&lt;/code&gt;&lt;/strong&gt;).&lt;/p&gt;




&lt;h1&gt;
  
  
  🌳 1. The Starting Point
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Unlike Windows, which uses different drive letters (like &lt;code&gt;C:&lt;/code&gt; or &lt;code&gt;D:&lt;/code&gt;), Linux puts everything into one giant "tree" structure.&lt;/p&gt;

&lt;p&gt;The Root Directory is the &lt;strong&gt;trunk&lt;/strong&gt; of that tree, and all other folders are "children" that branch out from it.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/
├── bin
├── boot
├── dev
├── etc
├── home
└── usr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  🚀 2. Essential for Booting
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;The computer cannot start up without the Root Directory.&lt;/p&gt;

&lt;p&gt;The partition containing this directory is the &lt;strong&gt;very first thing "mounted"&lt;/strong&gt; (attached to the system) when you turn on the computer.&lt;/p&gt;

&lt;p&gt;If the system cannot find it, it will not boot.&lt;/p&gt;




&lt;h1&gt;
  
  
  📂 3. Standard Folders inside Root
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;To keep systems organized and consistent, there is a set of standard folders that are required to be inside the Root Directory.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/bin&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Essential programs that everyone can use.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Essential Command Binaries:&lt;/strong&gt; This directory contains &lt;strong&gt;fundamental system programs&lt;/strong&gt; that must be available to all users. These tools, such as &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cp&lt;/code&gt;, and &lt;code&gt;cat&lt;/code&gt;, are considered essential because they are needed even when only the root partition is mounted, such as during system repair or in single-user mode.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/boot&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;The files needed to start the computer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Static Files of the Boot Loader):&lt;/strong&gt; This folder stores everything required for the &lt;strong&gt;boot process&lt;/strong&gt; except for certain boot-loader configuration files. It contains the system kernel, sector/system map files, and other data used before the kernel begins executing programs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/dev&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Special files that represent your hardware (like your mouse or hard drive).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Device Files):&lt;/strong&gt; This is the location for special files that represent your &lt;strong&gt;hardware&lt;/strong&gt;. In Linux, everything is treated as a file; for example, &lt;code&gt;/dev/hda1&lt;/code&gt; represents a hard drive partition, while &lt;code&gt;/dev/dsp&lt;/code&gt; represents your speakers.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/etc&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;The "nerve center" containing all your system settings and configuration files.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Host-Specific System Configuration):&lt;/strong&gt; Known as the &lt;strong&gt;"nerve center"&lt;/strong&gt; of the system, this directory contains all static configuration files used to control program operations. It does not contain any binary programs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/lib&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Essential shared libraries and kernel modules required for core system programs to run.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Essential Shared Libraries and Kernel Modules):&lt;/strong&gt; This directory holds the &lt;strong&gt;code libraries&lt;/strong&gt; (similar to DLLs in Windows) that are absolutely necessary to boot the system and run the commands found in &lt;code&gt;/bin&lt;/code&gt; and &lt;code&gt;/sbin&lt;/code&gt;. It also houses kernel modules, which act as hardware drivers.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;media&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Used for automatically mounted removable devices like USB drives and CDs/DVDs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Mount Point for Removable Media):&lt;/strong&gt; This directory provides a standard location for mounting &lt;strong&gt;removable devices&lt;/strong&gt; like floppy disks, CD-ROMs, and zip disks. Historically, these were scattered in various places, but &lt;code&gt;/media&lt;/code&gt; was created to keep the root directory tidy.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;mnt&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;A temporary location used by administrators to manually mount filesystems.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Mount Point for Temporary Filesystems):&lt;/strong&gt; This is a generic directory provided so that a system administrator can &lt;strong&gt;temporarily mount&lt;/strong&gt; a filesystem as needed.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;opt&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Stores optional or third-party software packages and applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Add-on Application Software Packages):&lt;/strong&gt; This area is reserved for &lt;strong&gt;third-party software&lt;/strong&gt; and add-on packages that are not part of the default system installation, such as office suites or web browsers.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/home&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Where users keep their personal files (this is actually optional, but very common).&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/root&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;The private home folder for the system administrator.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/sbin&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Important tools used specifically for system maintenance and repair.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Essential System Binaries):&lt;/strong&gt; Similar to &lt;code&gt;/bin&lt;/code&gt;, this directory contains binaries essential to the system's operation, but these are primarily intended for &lt;strong&gt;system maintenance&lt;/strong&gt; and administrative tasks performed by the root user.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;srv&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Contains data used by services provided by the system, such as web or FTP servers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Data for Services Provided by the System):&lt;/strong&gt; This directory contains &lt;strong&gt;site-specific data&lt;/strong&gt; that is served by the system, such as files for web or FTP services. &lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/tmp&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;A place for programs to store files temporarily while they are running.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Temporary Files):&lt;/strong&gt; Programs use this directory to store data they only need &lt;strong&gt;temporarily&lt;/strong&gt;. Files here are usually cleared out whenever the system is booted or shut down.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/usr&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Usually the largest folder; it contains most of the user's programs and documentation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Secondary Hierarchy):&lt;/strong&gt; This is typically the &lt;strong&gt;largest directory&lt;/strong&gt; on the system, containing the vast majority of user binaries, documentation, and libraries. It is intended to contain shareable, read-only data.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;/var&lt;/code&gt;
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Holds data that changes constantly, like system logs and emails.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;(Variable Data):&lt;/strong&gt; This directory stores files that &lt;strong&gt;change constantly&lt;/strong&gt; during normal system operation. This includes system logs, mail spools, and printer queues.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🧹 4. Tidy Organization
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Historically, the system administrator's personal files were kept directly in the Root Directory, but modern standards now give the administrator their own separate folder (&lt;strong&gt;&lt;code&gt;/root&lt;/code&gt;&lt;/strong&gt;) to keep the main Root Directory tidy and organized.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Superblock || Inode || Directory || Data Blocks</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Tue, 12 May 2026 16:28:14 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/superblock-inode-directory-data-blocks-433h</link>
      <guid>https://dev.to/itsmecharan7/superblock-inode-directory-data-blocks-433h</guid>
      <description>&lt;h1&gt;
  
  
  🗺️ 1. The Superblock: The Master Map
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;strong&gt;superblock&lt;/strong&gt; contains high-level information about the entire filesystem. It acts as a master controller that knows the "big picture," such as the total size of the filesystem and how much space is currently being used.&lt;/p&gt;




&lt;h1&gt;
  
  
  🪪 2. The Inode: The File’s Identity Card
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;An &lt;strong&gt;inode&lt;/strong&gt; (index node) is a record that stores almost everything about a specific file, such as who owns it and what its permissions are.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Crucial Fact:&lt;/strong&gt; The inode does &lt;strong&gt;not&lt;/strong&gt; store the file's name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Instead, it stores the numbers of the &lt;strong&gt;data blocks&lt;/strong&gt; where the file's content is physically located on the disk.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In a very real sense, the inode &lt;em&gt;is&lt;/em&gt; the file, as it holds all the vital metadata and location data.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔗 3. The Directory Entry: The Name Link
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Because the inode doesn't know the file's name, the system uses a &lt;strong&gt;directory entry&lt;/strong&gt; to link a human-readable filename to a specific inode number.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A directory is essentially a simple list or "phonebook" where each entry consists of a &lt;strong&gt;filename&lt;/strong&gt; paired with its &lt;strong&gt;inode number&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  💽 4. Data Blocks: The Storage Units
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Data blocks&lt;/strong&gt; are the physical parts of the disk where the actual content of your file is kept.&lt;/p&gt;

&lt;p&gt;When you open a document, the computer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Looks up the inode&lt;/li&gt;
&lt;li&gt;Finds the block numbers listed inside it&lt;/li&gt;
&lt;li&gt;Reads those specific data blocks&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;to show you your information.&lt;/p&gt;




&lt;h1&gt;
  
  
  📚 5. Indirect Blocks: The Overflow List
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;An inode only has a fixed amount of space, which means it can only list a few data block numbers directly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;If a file is very large and needs more data blocks than the inode can hold, the system creates &lt;strong&gt;indirect blocks&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;These are specialized blocks that don't hold your file's data, but instead hold a &lt;strong&gt;longer list of pointers&lt;/strong&gt; to even more data blocks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To find the contents of a massive file, the computer first goes to the inode, then to the indirect block, and finally to the actual data blocks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>📘 Making a Filesystem</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Tue, 12 May 2026 16:19:06 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/making-a-filesystem-59h5</link>
      <guid>https://dev.to/itsmecharan7/making-a-filesystem-59h5</guid>
      <description>&lt;h1&gt;
  
  
  What is Making a filesystem?
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Making a filesystem&lt;/strong&gt; is the technical process of &lt;strong&gt;initializing a partition or disk&lt;/strong&gt; so that it can be used to store and organize files. Before this process occurs, a disk is simply raw storage space that most programs cannot use.&lt;/p&gt;




&lt;h1&gt;
  
  
  🗺️ The Purpose: Writing the "Map"
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you make a filesystem, the operating system writes &lt;strong&gt;bookkeeping data structures&lt;/strong&gt; onto the physical sectors of the disk. These structures act as a master map that allows the computer to keep track of where files begin and end.&lt;/p&gt;

&lt;p&gt;The central components created during this process include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Superblock:&lt;/strong&gt; This contains high-level information about the entire filesystem, such as its &lt;strong&gt;total size&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Inodes:&lt;/strong&gt; These are individual maps for every file. An inode stores everything about a file—like &lt;strong&gt;permissions and timestamps&lt;/strong&gt;—except for its name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Blocks:&lt;/strong&gt; These are the actual physical areas where the &lt;strong&gt;content of your files&lt;/strong&gt; will be stored.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Directory Entries:&lt;/strong&gt; These link a &lt;strong&gt;filename&lt;/strong&gt; to its specific inode number so the system can find it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🛠️ The Specialized Tools Used
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Because this process requires interacting with the physical disk directly, it requires &lt;strong&gt;specialized programs&lt;/strong&gt; found in the &lt;code&gt;/sbin&lt;/code&gt; directory:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;mkfs&lt;/code&gt;&lt;/strong&gt;: The primary command used to &lt;strong&gt;build a filesystem&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;mkfs.*&lt;/code&gt;&lt;/strong&gt;: Specific versions of the tool used for different filesystem types (such as &lt;code&gt;mkfs.ext2&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;mkswap&lt;/code&gt;&lt;/strong&gt;: A tool used to initialize a partition specifically for &lt;strong&gt;swap space&lt;/strong&gt; (virtual memory).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔗 The Practical Result
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Once a filesystem is "made," it must then be &lt;strong&gt;mounted&lt;/strong&gt; before you can use it. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While the &lt;strong&gt;device file&lt;/strong&gt; (like &lt;code&gt;/dev/hda2&lt;/code&gt;) gives the system access to the raw disk sectors, the &lt;strong&gt;mount point&lt;/strong&gt; (the folder where you attach the filesystem) gives you access to the actual files.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  ⚠️ Why It Is Dangerous
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;As discussed in our conversation, tools like &lt;code&gt;mkfs&lt;/code&gt; operate directly on the &lt;strong&gt;raw sectors&lt;/strong&gt; of a disk. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;They do not check to see if your photos or documents are already there; they simply begin writing the new "map" over the existing data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you run this process on a partition that already contains files, the existing filesystem will be &lt;strong&gt;destroyed or seriously corrupted&lt;/strong&gt; because its original organization system has been overwritten.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>📘 Filesystem vs Storage Area (Disk or Partition)</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Tue, 12 May 2026 16:06:28 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/filesystem-vs-storage-area-disk-or-partition-3g0m</link>
      <guid>https://dev.to/itsmecharan7/filesystem-vs-storage-area-disk-or-partition-3g0m</guid>
      <description>&lt;h1&gt;
  
  
  📂 What is a Filesystem?
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;A filesystem is the set of &lt;strong&gt;rules and organization tools&lt;/strong&gt; an operating system uses to manage files.&lt;/p&gt;

&lt;p&gt;Without a filesystem, a computer wouldn't know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where one file begins&lt;/li&gt;
&lt;li&gt;Where another file ends&lt;/li&gt;
&lt;li&gt;How files are stored and retrieved&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🧠 The Word "Filesystem" Has 3 Meanings
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;The word &lt;strong&gt;filesystem&lt;/strong&gt; is often used in three different ways:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;🔢 Meaning&lt;/th&gt;
&lt;th&gt;📝 Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1️⃣ The Method&lt;/td&gt;
&lt;td&gt;The specific way files are organized&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2️⃣ The Space&lt;/td&gt;
&lt;td&gt;A specific partition or disk used to store files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3️⃣ The Type&lt;/td&gt;
&lt;td&gt;The specific format being used, such as EXT2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Example:&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="s2"&gt;"I have two filesystems"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;could mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two partitions&lt;/li&gt;
&lt;li&gt;Two mounted storage areas&lt;/li&gt;
&lt;li&gt;Two filesystem structures&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  💽 The Partition vs. The Filesystem
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A &lt;strong&gt;disk or partition&lt;/strong&gt; is just a raw, empty storage space.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A &lt;strong&gt;filesystem&lt;/strong&gt; is the structure written onto that space to make it usable.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔹 Disk / Partition
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think of it as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;An empty piece of land
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It has storage capacity but no organization.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 Filesystem
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think of it as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Roads, buildings, addresses, and maps built on the land
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The filesystem organizes the storage space so files can be stored properly.&lt;/p&gt;




&lt;h1&gt;
  
  
  ⚙️ Initialization
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Before you can save files on a new partition, you must &lt;strong&gt;initialize&lt;/strong&gt; it.&lt;/p&gt;

&lt;p&gt;This process is called:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Making a filesystem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;During initialization, Linux writes important bookkeeping structures onto the disk, such as:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;📘 Structure&lt;/th&gt;
&lt;th&gt;📝 Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Superblocks&lt;/td&gt;
&lt;td&gt;Store filesystem metadata&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inodes&lt;/td&gt;
&lt;td&gt;Store information about files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Allocation Tables&lt;/td&gt;
&lt;td&gt;Track used and free space&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  🔗 Mounting
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;In Linux, the system does not automatically access files on a partition.&lt;/p&gt;

&lt;p&gt;You must:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Mount the filesystem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mounting attaches the filesystem to a folder called a:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Mount point
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&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;sudo &lt;/span&gt;mount /dev/sdb1 /mnt/data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the files accessible through:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/mnt/data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  ⚠️ Why the Difference Matters
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Understanding the difference between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;storage device&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;filesystem&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;is extremely important.&lt;/p&gt;




&lt;h1&gt;
  
  
  🖥️ Most Programs Need a Filesystem
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Almost every application you use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web browsers&lt;/li&gt;
&lt;li&gt;Word processors&lt;/li&gt;
&lt;li&gt;Media players&lt;/li&gt;
&lt;li&gt;Editors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;requires a filesystem to work properly.&lt;/p&gt;

&lt;p&gt;These programs &lt;strong&gt;cannot communicate directly with a raw disk&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  💽 1. Examples of a "Raw, Unformatted Disk"
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;A "raw" disk or partition is simply the physical or logical storage space before any organization (a filesystem) has been added to it.&lt;/p&gt;

&lt;p&gt;In Linux, these are represented by &lt;strong&gt;device files&lt;/strong&gt; found in the:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;directory.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 Entire Hard Drive
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/dev/hda
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This represents an entire raw hard drive.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 Partitions on a Hard Drive
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/dev/hda1
/dev/hda2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These represent specific &lt;strong&gt;partitions&lt;/strong&gt; (slices of space) on that hard drive.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 Floppy Disk Drive
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/dev/fd0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This represents a raw floppy disk drive.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧠 Important Concept
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you access these device files, you are interacting with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The raw sectors of the hardware itself
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;rather than the files stored inside them.&lt;/p&gt;




&lt;h1&gt;
  
  
  🛠️ Specialized Low-Level Tools
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Some special tools work directly with the raw physical sectors of a disk.&lt;/p&gt;

&lt;p&gt;Examples include tools that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create filesystems&lt;/li&gt;
&lt;li&gt;Partition disks&lt;/li&gt;
&lt;li&gt;Recover data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tools bypass the filesystem layer completely.&lt;/p&gt;




&lt;h1&gt;
  
  
  🛠️ 2. Examples of "Specialized Tools"
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Specialized tools are programs designed to interact directly with the hardware's raw sectors to prepare them for use or manage the storage structure.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;mkfs&lt;/code&gt; - Make Filesystem
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkfs.ext4 /dev/hda1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tool is used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating filesystems&lt;/li&gt;
&lt;li&gt;Initializing partitions&lt;/li&gt;
&lt;li&gt;Writing filesystem structures&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It creates important bookkeeping structures such as:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;📘 Structure&lt;/th&gt;
&lt;th&gt;📝 Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Superblocks&lt;/td&gt;
&lt;td&gt;Store filesystem metadata&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inodes&lt;/td&gt;
&lt;td&gt;Store file information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Allocation Tables&lt;/td&gt;
&lt;td&gt;Track used/free blocks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;fdisk&lt;/code&gt; - Partition Management
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fdisk /dev/hda
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tool is used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create partitions&lt;/li&gt;
&lt;li&gt;Delete partitions&lt;/li&gt;
&lt;li&gt;Modify partition tables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It works directly on the raw disk structure.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 &lt;code&gt;mkswap&lt;/code&gt; - Prepare Swap Space
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkswap /dev/hda2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prepares a partition to be used as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Swap space (virtual memory)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;instead of a regular filesystem.&lt;/p&gt;




&lt;h1&gt;
  
  
  ☠️ The Danger
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you use a specialized raw disk tool on a partition that already contains files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The filesystem may become corrupted&lt;/li&gt;
&lt;li&gt;Existing data may be destroyed&lt;/li&gt;
&lt;li&gt;The partition may become unreadable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is because the tool writes directly to the disk sectors without caring about existing files.&lt;/p&gt;




&lt;h1&gt;
  
  
  🚨 Important Warning
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Operations such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkfs
fdisk
parted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can permanently destroy data if used incorrectly.&lt;/p&gt;

&lt;p&gt;Always verify the target disk or partition before running low-level storage commands.&lt;/p&gt;




&lt;h1&gt;
  
  
  ⚠️ 3. Why the Difference Matters (The Danger)
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;The distinction between:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A raw disk&lt;/li&gt;
&lt;li&gt;A filesystem&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;is extremely important because of how programs interact with storage devices.&lt;/p&gt;




&lt;h1&gt;
  
  
  👨‍💻 Most Programs (The Users)
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Applications such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web browsers&lt;/li&gt;
&lt;li&gt;Word processors&lt;/li&gt;
&lt;li&gt;Video players&lt;/li&gt;
&lt;li&gt;Editors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;cannot understand raw disk sectors.&lt;/p&gt;

&lt;p&gt;They require a:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to act as a map for locating and managing files.&lt;/p&gt;

&lt;p&gt;Programs access storage through:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Mount points
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;/home
/var
/mnt/data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  🏗️ Specialized Tools (The Builders)
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Tools such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkfs
fdisk
mkswap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;do not use the filesystem map.&lt;/p&gt;

&lt;p&gt;Instead, they write directly to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Raw disk sectors
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  ☠️ The Danger
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Suppose you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkfs.ext4 /dev/hda2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;on a partition that already contains files.&lt;/p&gt;

&lt;p&gt;The tool will NOT:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check for your documents&lt;/li&gt;
&lt;li&gt;Protect your photos&lt;/li&gt;
&lt;li&gt;Ask whether important data exists&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead, it will overwrite the filesystem metadata structures with a brand-new empty filesystem.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧨 What Gets Destroyed?
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;The following critical structures may be overwritten:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;📘 Structure&lt;/th&gt;
&lt;th&gt;❌ Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Superblock&lt;/td&gt;
&lt;td&gt;Filesystem metadata destroyed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inodes&lt;/td&gt;
&lt;td&gt;File references lost&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Allocation Tables&lt;/td&gt;
&lt;td&gt;Disk usage map erased&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  🧩 Important Detail
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Even if the actual file data bits still physically exist on the disk:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The "map" used to locate those files is gone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Files become inaccessible&lt;/li&gt;
&lt;li&gt;The filesystem becomes corrupted&lt;/li&gt;
&lt;li&gt;Data recovery becomes difficult or impossible&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  ✅ Quick Summary
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;📌 Concept&lt;/th&gt;
&lt;th&gt;📝 Explanation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Raw Disk&lt;/td&gt;
&lt;td&gt;Physical storage sectors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Partition&lt;/td&gt;
&lt;td&gt;A slice of disk storage (Raw storage space)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Filesystem&lt;/td&gt;
&lt;td&gt;Organizational structure for files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Initialization&lt;/td&gt;
&lt;td&gt;Creating filesystem structures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mounting&lt;/td&gt;
&lt;td&gt;Attaching filesystem to a directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Raw Disk Tools&lt;/td&gt;
&lt;td&gt;Access physical disk sectors directly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/dev/hda1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Raw partition device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mkfs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates filesystems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fdisk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Manages partitions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mkswap&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates swap space&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mount Point&lt;/td&gt;
&lt;td&gt;Directory used to access a filesystem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Danger&lt;/td&gt;
&lt;td&gt;Low-level tools can destroy filesystem metadata&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>beginners</category>
      <category>computerscience</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>📘 Linux Filesystem Hierarchy</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Tue, 12 May 2026 15:09:46 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/linux-filesystem-hierarchy-511j</link>
      <guid>https://dev.to/itsmecharan7/linux-filesystem-hierarchy-511j</guid>
      <description>&lt;h1&gt;
  
  
  📂 What is a Filesystem?
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A filesystem is simply the method an operating system uses to &lt;strong&gt;keep track of files&lt;/strong&gt; on a disk or partition. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It is the way files are organized and managed so the computer knows where everything is stored.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🌳 The "Tree" Structure
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Unlike Windows, which uses different "drives" like &lt;code&gt;C:&lt;/code&gt;, &lt;code&gt;D:&lt;/code&gt;, and &lt;code&gt;E:&lt;/code&gt;, Linux uses a &lt;strong&gt;single hierarchical structure&lt;/strong&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Everything starts from one place called the &lt;strong&gt;root directory&lt;/strong&gt;, represented by a single forward slash (&lt;code&gt;/&lt;/code&gt;). &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All other folders and files "branch out" from this root like a tree.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔑 Key Differences from Windows
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🔹 The Slash
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Linux uses the forward slash (&lt;code&gt;/&lt;/code&gt;) for directories, whereas Windows uses the backslash (&lt;code&gt;\&lt;/code&gt;).&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;🐧 Linux&lt;/th&gt;
&lt;th&gt;🪟 Windows&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/home/charan/docs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;C:\Users\Charan\docs&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔹 Case Sensitivity
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Linux cares about capital letters. For example, a file named:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;is completely different from:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔹 Organized by Function
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;In Windows, a program usually keeps all its files in one folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\Program Files\App
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Linux, a program's files are &lt;strong&gt;split up and placed into different folders&lt;/strong&gt; based on what they do.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;📁 File Type&lt;/th&gt;
&lt;th&gt;📍 Linux Location&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Program binaries&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/usr/bin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Configuration files&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/etc&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Help manuals&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/usr/share/man&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  💽 Mounting and Safety
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🔹 Mounting
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;In Linux, your computer doesn't automatically "see" a new disk or USB drive just because it's plugged in. You have to &lt;strong&gt;"mount"&lt;/strong&gt; it, which tells Linux where to attach that device's files into the main system "tree".&lt;/p&gt;




&lt;h2&gt;
  
  
  🔹 Proper Shutdown
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Linux uses &lt;strong&gt;"caching,"&lt;/strong&gt; which means it temporarily stores data in its fast memory before writing it to the slow disk.&lt;/p&gt;

&lt;p&gt;Because of this, you should &lt;strong&gt;never just flip the power switch off&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You must use a shutdown command to ensure that all data is safely saved to the disk first.&lt;/p&gt;




&lt;h1&gt;
  
  
  📏 Why Is There a Standard?
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the early days of Linux, different versions (called distributions) put files in different places, which caused &lt;strong&gt;anarchy and confusion&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;FSSTND&lt;/strong&gt; (Filesystem Standard) was created to fix this.&lt;/p&gt;

&lt;p&gt;Having a standard location for files provides several benefits:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. 👤 For Users
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;You can find your programs even if you switch to a different version of Linux.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. 🛠️ For Administrators
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;It makes it much easier to upgrade your system.&lt;/li&gt;
&lt;li&gt;Easier to get support from others.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. 👨‍💻 For Developers
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;They can write software that works on all Linux systems because they know exactly where important tools are located.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🌐 The Reality
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;The standard is not perfect.&lt;/p&gt;

&lt;p&gt;Different versions of Linux, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Red Hat&lt;/li&gt;
&lt;li&gt;Debian&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;still have some small differences in how they organize things.&lt;/p&gt;

&lt;p&gt;Because of this, groups like the Linux Standard Base continue to work on making all Linux systems more consistent.&lt;/p&gt;




&lt;h1&gt;
  
  
  ✅ Quick Summary
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;📌 Topic&lt;/th&gt;
&lt;th&gt;📝 Explanation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Filesystem&lt;/td&gt;
&lt;td&gt;Organizes and tracks files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Root Directory&lt;/td&gt;
&lt;td&gt;Everything starts from &lt;code&gt;/&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linux Structure&lt;/td&gt;
&lt;td&gt;Single tree hierarchy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Case Sensitivity&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Work&lt;/code&gt; ≠ &lt;code&gt;work&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mounting&lt;/td&gt;
&lt;td&gt;Devices must be attached to the filesystem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shutdown&lt;/td&gt;
&lt;td&gt;Prevents data corruption&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Standards&lt;/td&gt;
&lt;td&gt;Keep Linux systems consistent&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Compile process on C in Windows</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Sat, 09 May 2026 11:18:01 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/compile-process-on-c-in-windows-2e8l</link>
      <guid>https://dev.to/itsmecharan7/compile-process-on-c-in-windows-2e8l</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;C is one of the most powerful and widely used programming languages in the world. Before a C program can run, the source code written by the programmer must be converted into machine-readable instructions through a process called &lt;strong&gt;compilation&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In Windows, this is commonly done using the &lt;strong&gt;GCC compiler&lt;/strong&gt; through the &lt;strong&gt;Command Prompt (CMD)&lt;/strong&gt; or Terminal.&lt;/p&gt;

&lt;p&gt;This guide explains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installing and verifying GCC&lt;/li&gt;
&lt;li&gt;Creating C source files&lt;/li&gt;
&lt;li&gt;Navigating folders using CMD&lt;/li&gt;
&lt;li&gt;Compiling programs&lt;/li&gt;
&lt;li&gt;Running executables&lt;/li&gt;
&lt;li&gt;Using compiler flags&lt;/li&gt;
&lt;li&gt;Understanding warnings and errors&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  1. Understanding the Compilation Process
&lt;/h1&gt;

&lt;p&gt;When you write a C program, the code is stored in a &lt;code&gt;.c&lt;/code&gt; file. Humans can read this code, but the computer cannot execute it directly.&lt;/p&gt;

&lt;p&gt;The compiler converts the code into an executable file (&lt;code&gt;.exe&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Flow of Execution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C Source Code (.c)
        ↓
Compiler (gcc)
        ↓
Executable File (.exe)
        ↓
Program Runs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  2. Prerequisites
&lt;/h1&gt;

&lt;p&gt;Before compiling C programs, you must install a &lt;strong&gt;C compiler toolchain&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The most common GCC-based toolchains for Windows are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Toolchain&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MinGW&lt;/td&gt;
&lt;td&gt;Minimalist GNU for Windows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MSYS2&lt;/td&gt;
&lt;td&gt;Modern GCC environment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TDM-GCC&lt;/td&gt;
&lt;td&gt;Simplified GCC distribution&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  3. Installing GCC on Windows
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Option 1: Install MinGW
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Download MinGW
&lt;/h3&gt;

&lt;p&gt;Visit:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.mingw-w64.org/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;MinGW Official Website&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Install the Toolchain
&lt;/h3&gt;

&lt;p&gt;During installation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select GCC compiler packages&lt;/li&gt;
&lt;li&gt;Install C compiler support&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: Add GCC to PATH
&lt;/h3&gt;

&lt;p&gt;You must add the &lt;code&gt;bin&lt;/code&gt; directory to the Windows Environment Variables.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\mingw64\bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  4. Verifying GCC Installation
&lt;/h1&gt;

&lt;p&gt;After installation, confirm GCC is accessible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open Command Prompt
&lt;/h2&gt;

&lt;p&gt;Press:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Windows + R
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cmd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press Enter.&lt;/p&gt;




&lt;h2&gt;
  
  
  Run Verification Command
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Expected Output
&lt;/h2&gt;

&lt;p&gt;If installed correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="o"&gt;(&lt;/span&gt;MinGW-W64 GCC&lt;span class="o"&gt;)&lt;/span&gt; 13.2.0
Copyright &lt;span class="o"&gt;(&lt;/span&gt;C&lt;span class="o"&gt;)&lt;/span&gt; Free Software Foundation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  If You Receive an Error
&lt;/h2&gt;

&lt;p&gt;Example:&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="s1"&gt;'gcc'&lt;/span&gt; is not recognized as an internal or external &lt;span class="nb"&gt;command&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GCC is not installed&lt;/li&gt;
&lt;li&gt;OR PATH variable is not configured properly&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  5. Creating Your First C Program
&lt;/h1&gt;

&lt;p&gt;You can use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Notepad&lt;/li&gt;
&lt;li&gt;VS Code&lt;/li&gt;
&lt;li&gt;Notepad++&lt;/li&gt;
&lt;li&gt;Sublime Text&lt;/li&gt;
&lt;li&gt;Vim&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  6. Creating a &lt;code&gt;.c&lt;/code&gt; Source File
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Step 1: Open Notepad
&lt;/h2&gt;

&lt;p&gt;Press:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Windows + R
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;notepad
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 2: Save the File Properly
&lt;/h2&gt;

&lt;p&gt;Go to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;File → Save As
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Important Settings
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;File Name&lt;/td&gt;
&lt;td&gt;&lt;code&gt;application.c&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Save as Type&lt;/td&gt;
&lt;td&gt;&lt;code&gt;All Files&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Encoding&lt;/td&gt;
&lt;td&gt;UTF-8&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Why "All Files" Matters
&lt;/h2&gt;

&lt;p&gt;If you leave it as Text Documents:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;application.c.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is NOT a valid C source file.&lt;/p&gt;

&lt;p&gt;Correct extension:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;application.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  7. Writing the C Program
&lt;/h1&gt;

&lt;p&gt;Example program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello world"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  8. Understanding the Program Line by Line
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Header File
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This imports the Standard Input Output library.&lt;/p&gt;

&lt;p&gt;It allows usage of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;printf()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;scanf()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Main Function
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the entry point of every C program.&lt;/p&gt;

&lt;p&gt;Execution always begins here.&lt;/p&gt;




&lt;h2&gt;
  
  
  Printing Output
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello world"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Displays text on the screen.&lt;/p&gt;




&lt;h2&gt;
  
  
  Return Statement
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Indicates successful execution.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. Opening Command Prompt in the Correct Folder
&lt;/h1&gt;

&lt;p&gt;The compiler must access your &lt;code&gt;.c&lt;/code&gt; file.&lt;/p&gt;




&lt;h1&gt;
  
  
  Method 1: Windows 11
&lt;/h1&gt;

&lt;p&gt;Inside the folder:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Right-click empty space&lt;/li&gt;
&lt;li&gt;Select:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Open in Terminal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Method 2: Older Windows Versions
&lt;/h1&gt;

&lt;p&gt;Inside File Explorer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the address bar&lt;/li&gt;
&lt;li&gt;Type:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cmd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Press Enter.&lt;/p&gt;

&lt;p&gt;CMD opens directly inside that folder.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. Checking Current Directory
&lt;/h1&gt;

&lt;p&gt;Use:&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;dir&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;application.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  11. Compiling the Program
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Basic Compilation
&lt;/h2&gt;

&lt;p&gt;Command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc application.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  What Happens Internally
&lt;/h1&gt;

&lt;p&gt;GCC:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads the source code&lt;/li&gt;
&lt;li&gt;Checks syntax&lt;/li&gt;
&lt;li&gt;Converts code into machine instructions&lt;/li&gt;
&lt;li&gt;Generates executable file&lt;/li&gt;
&lt;/ol&gt;




&lt;h1&gt;
  
  
  Output File
&lt;/h1&gt;

&lt;p&gt;Default executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  12. Running the Program
&lt;/h1&gt;

&lt;p&gt;Execute:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;a.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Expected Output
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  13. Creating Custom Executable Names
&lt;/h1&gt;

&lt;p&gt;Instead of &lt;code&gt;a.exe&lt;/code&gt;, you can specify your own filename.&lt;/p&gt;




&lt;h1&gt;
  
  
  Using the &lt;code&gt;-o&lt;/code&gt; Flag
&lt;/h1&gt;

&lt;p&gt;Command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc application.c &lt;span class="nt"&gt;-o&lt;/span&gt; application.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Breakdown
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;gcc&lt;/td&gt;
&lt;td&gt;Compiler&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;application.c&lt;/td&gt;
&lt;td&gt;Source file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-o&lt;/td&gt;
&lt;td&gt;Output flag&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;application.exe&lt;/td&gt;
&lt;td&gt;Output executable&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  Running the Custom Executable
&lt;/h1&gt;



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

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hello world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  14. Understanding Compiler Flags
&lt;/h1&gt;

&lt;p&gt;Flags modify compiler behavior.&lt;/p&gt;




&lt;h1&gt;
  
  
  Most Common GCC Flags
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Flag&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-o&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specify output file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-Wall&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Enable warnings&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-g&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Debug information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-O2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Optimization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-std=c11&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Use C11 standard&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  15. Using &lt;code&gt;-Wall&lt;/code&gt; for Warnings
&lt;/h1&gt;

&lt;p&gt;Command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-Wall&lt;/span&gt; application.c &lt;span class="nt"&gt;-o&lt;/span&gt; app.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Why Warnings Matter
&lt;/h1&gt;

&lt;p&gt;Warnings help detect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unused variables&lt;/li&gt;
&lt;li&gt;Missing return values&lt;/li&gt;
&lt;li&gt;Dangerous conversions&lt;/li&gt;
&lt;li&gt;Suspicious code&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Example Warning
&lt;/h1&gt;

&lt;p&gt;Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compilation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-Wall&lt;/span&gt; app.c &lt;span class="nt"&gt;-o&lt;/span&gt; app.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Warning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;warning: unused variable 'x'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  16. Difference Between Warnings and Errors
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Warnings&lt;/th&gt;
&lt;th&gt;Errors&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Program still compiles&lt;/td&gt;
&lt;td&gt;Compilation stops&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Indicates risky code&lt;/td&gt;
&lt;td&gt;Indicates invalid code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Executable created&lt;/td&gt;
&lt;td&gt;No executable created&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  17. Example of a Compilation Error
&lt;/h1&gt;

&lt;p&gt;Incorrect code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello world"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Error Explanation
&lt;/h1&gt;

&lt;p&gt;Missing semicolon:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello world"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compiler output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;error: expected ';'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No &lt;code&gt;.exe&lt;/code&gt; file is generated.&lt;/p&gt;




&lt;h1&gt;
  
  
  18. Useful CMD Commands for C Development
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dir&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Change directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cls&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Clear screen&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mkdir&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;del&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Delete file&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  Example Workflow
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Step 1: Navigate
&lt;/h2&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;Desktop&lt;span class="se"&gt;\C&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 2: Compile
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-Wall&lt;/span&gt; application.c &lt;span class="nt"&gt;-o&lt;/span&gt; app.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 3: Run
&lt;/h2&gt;



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

&lt;/div&gt;






&lt;h1&gt;
  
  
  19. Recommended Folder Structure
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C-Projects/
│
├── HelloWorld/
│   ├── application.c
│   └── app.exe
│
├── Calculator/
│   ├── calc.c
│   └── calc.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  20. Best Practices
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Always Use Warnings
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-Wall&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Use Meaningful Filenames
&lt;/h2&gt;

&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;calculator.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Keep Source and Executables Organized
&lt;/h2&gt;

&lt;p&gt;Separate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Source code&lt;/li&gt;
&lt;li&gt;Build files&lt;/li&gt;
&lt;li&gt;Executables&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  21. Common Beginner Mistakes
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mistake&lt;/th&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Saving as &lt;code&gt;.txt&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Compiler cannot detect C file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Forgetting semicolons&lt;/td&gt;
&lt;td&gt;Compilation errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wrong folder in CMD&lt;/td&gt;
&lt;td&gt;File not found&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GCC not in PATH&lt;/td&gt;
&lt;td&gt;Command not recognized&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  22. Full Example Session
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Source Code
&lt;/h2&gt;

&lt;p&gt;File: &lt;code&gt;hello.c&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello from C!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Compilation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-Wall&lt;/span&gt; hello.c &lt;span class="nt"&gt;-o&lt;/span&gt; hello.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Execution
&lt;/h2&gt;



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

&lt;/div&gt;






&lt;h2&gt;
  
  
  Output
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello from C!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  23. Summary
&lt;/h1&gt;

&lt;p&gt;Using GCC in Windows Command Prompt involves four major steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install GCC&lt;/li&gt;
&lt;li&gt;Write C code&lt;/li&gt;
&lt;li&gt;Compile using &lt;code&gt;gcc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run the executable&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Core command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc filename.c &lt;span class="nt"&gt;-o&lt;/span&gt; output.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Recommended command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-Wall&lt;/span&gt; filename.c &lt;span class="nt"&gt;-o&lt;/span&gt; output.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This workflow forms the foundation of C development and helps build a deeper understanding of how programming languages interact with the operating system and hardware.&lt;/p&gt;




&lt;h1&gt;
  
  
  Short Summary: Compiling and Executing a C Program in Windows
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Step 1: Write the C Program
&lt;/h2&gt;

&lt;p&gt;Create a C source file with the &lt;code&gt;.c&lt;/code&gt; extension.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save it as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;application.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 2: Open Command Prompt in the File Location
&lt;/h1&gt;

&lt;p&gt;Navigate to the folder containing the &lt;code&gt;.c&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Example:&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;Desktop&lt;span class="se"&gt;\C&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 3: Compile the Program
&lt;/h1&gt;

&lt;p&gt;Compilation converts human-readable C code into machine-executable code (&lt;code&gt;.exe&lt;/code&gt; file).&lt;/p&gt;




&lt;h1&gt;
  
  
  Case 1: Compile WITHOUT Output Filename
&lt;/h1&gt;

&lt;p&gt;Command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc application.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Happens?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GCC compiles the source code.&lt;/li&gt;
&lt;li&gt;A default executable file is automatically created.&lt;/li&gt;
&lt;li&gt;Default executable name in Windows:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Execute the Program
&lt;/h2&gt;



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

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;a.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Case 2: Compile WITH Output Filename
&lt;/h1&gt;

&lt;p&gt;Command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc application.c &lt;span class="nt"&gt;-o&lt;/span&gt; application.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What Happens?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GCC compiles the source code.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;-o&lt;/code&gt; flag tells GCC to create a custom executable name.&lt;/li&gt;
&lt;li&gt;Executable created:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;application.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Execute the Program
&lt;/h2&gt;



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

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;application.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Difference Between Both Methods
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Without &lt;code&gt;-o&lt;/code&gt;
&lt;/th&gt;
&lt;th&gt;With &lt;code&gt;-o&lt;/code&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Default executable name&lt;/td&gt;
&lt;td&gt;Custom executable name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Creates &lt;code&gt;a.exe&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Creates specified filename&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Less organized&lt;/td&gt;
&lt;td&gt;More professional and manageable&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  Recommended Method
&lt;/h1&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc application.c &lt;span class="nt"&gt;-o&lt;/span&gt; application.exe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easier to identify executables&lt;/li&gt;
&lt;li&gt;Better project organization&lt;/li&gt;
&lt;li&gt;Prevents overwriting &lt;code&gt;a.exe&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Standard industry practice&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Configuration Directive</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Mon, 04 May 2026 04:27:32 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/configuration-directive-28n9</link>
      <guid>https://dev.to/itsmecharan7/configuration-directive-28n9</guid>
      <description>&lt;h2&gt;
  
  
  ⚙️ What is a Configuration Directive?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the world of software and web servers, a &lt;strong&gt;configuration directive&lt;/strong&gt; is essentially a &lt;strong&gt;specific instruction or rule given to a program that tells it how to behave or how to manage resources&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think of it as a setting in a high-powered control panel. Instead of clicking a button in a UI, you write a line of text in a configuration file like &lt;code&gt;.conf&lt;/code&gt;, &lt;code&gt;.yaml&lt;/code&gt;, or &lt;code&gt;.ini&lt;/code&gt; to define behavior.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔧 Simple Definition
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;A &lt;strong&gt;configuration directive&lt;/strong&gt; is simply an &lt;strong&gt;instruction or setting written inside a configuration file that tells a system how to behave&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Think of it like a rule or command that controls software without changing the actual code.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;configuration directive = key instruction that defines behavior of software/system&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Real-World Analogy
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Remote control buttons → directives&lt;/li&gt;
&lt;li&gt;Press “volume up” → system behaves accordingly&lt;/li&gt;
&lt;li&gt;Same idea: directive → system follows it&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💻 Example 1: Web Server (Apache)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;File: &lt;code&gt;httpd.conf&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="nc"&gt;Listen&lt;/span&gt; 80
&lt;span class="nc"&gt;DocumentRoot&lt;/span&gt; "/var/www/html"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Listen 80&lt;/code&gt; → server listens on port 80&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DocumentRoot&lt;/code&gt; → where website files are stored
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Each line = **configuration directive**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  💻 Example 2: Nginx
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;File: &lt;code&gt;nginx.conf&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;worker_processes&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Directive tells Nginx how many worker processes to run&lt;/p&gt;




&lt;h2&gt;
  
  
  💻 Example 3: Linux (sysctl)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;File: &lt;code&gt;/etc/sysctl.conf&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;net.ipv4.ip_forward &lt;span class="o"&gt;=&lt;/span&gt; 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Enables IP forwarding&lt;/p&gt;




&lt;h2&gt;
  
  
  💻 Example 4: Your DevOps World (very relevant)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  YAML (Kubernetes / Ansible)
&lt;/h3&gt;

&lt;blockquote&gt;

&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 Directive tells Kubernetes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;run 3 pods&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔥 Key Characteristics
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Written in config files (not code)&lt;/li&gt;
&lt;li&gt;Defines behavior, limits, or rules&lt;/li&gt;
&lt;li&gt;Read by software at runtime or startup&lt;/li&gt;
&lt;li&gt;Can be changed without recompiling code&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🎯 Targeted Control
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Each directive controls &lt;strong&gt;one specific aspect&lt;/strong&gt; of the software’s functionality.&lt;/p&gt;

&lt;h3&gt;
  
  
  🧾 Syntax-Dependent
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Directives must follow strict syntax rules.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ Missing semicolon&lt;/li&gt;
&lt;li&gt;❌ Typo in keyword

&lt;ul&gt;
&lt;li&gt;👉 Result: service may fail to start&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  🌍 Scope
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Directives can operate at different levels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🌐 &lt;strong&gt;Global&lt;/strong&gt; → affects entire system&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Block-level&lt;/strong&gt; → affects specific section (e.g. one website)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚠️ Blunt Reality (important)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you don’t understand directives properly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You’ll blindly copy configs&lt;/li&gt;
&lt;li&gt;Debugging becomes painful&lt;/li&gt;
&lt;li&gt;Production issues become guesswork&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A strong DevOps engineer &lt;strong&gt;reads directives like code&lt;/strong&gt; and knows:&lt;br&gt;
👉 what it does&lt;br&gt;
👉 why it exists&lt;br&gt;
👉 impact if changed&lt;/p&gt;


&lt;h2&gt;
  
  
  🤔 Why Use Directives Instead of GUI?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  ⚡ 1. Automation
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Deploy same config to 1000+ servers instantly using scripts&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  🗂️ 2. Version Control
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Track every change using Git

&lt;ul&gt;
&lt;li&gt;👉 Who changed what, when, and why&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  🚀 3. Speed &amp;amp; Efficiency
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;No UI overhead&lt;/li&gt;
&lt;li&gt;Lightweight&lt;/li&gt;
&lt;li&gt;Faster execution&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  ⚠️ Reality Check (DevOps Mindset)
&lt;/h2&gt;

&lt;blockquote&gt;

&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;- Copy-paste configs blindly
&lt;/span&gt;&lt;span class="gi"&gt;+ Understand every directive you use
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you don’t:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debugging becomes painful&lt;/li&gt;
&lt;li&gt;Production issues become guesswork&lt;/li&gt;
&lt;li&gt;You lose control over systems&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🧠 Pro Tip
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Always keep a backup of config files&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&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;nginx.conf nginx.conf.bak
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even a &lt;strong&gt;single typo&lt;/strong&gt; can cause:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;❌ Service crash&lt;/li&gt;
&lt;li&gt;❌ 500 Internal Server Error&lt;/li&gt;
&lt;li&gt;❌ Downtime&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧩 One-Line Summary
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;A &lt;strong&gt;configuration directive is a specific instruction inside a config file that controls how a system or application operates.&lt;/strong&gt;&lt;/p&gt;




</description>
    </item>
    <item>
      <title>Automated (Metric-based) Evaluation</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Mon, 26 Jan 2026 01:58:17 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/automated-metric-based-evaluation-267f</link>
      <guid>https://dev.to/itsmecharan7/automated-metric-based-evaluation-267f</guid>
      <description>&lt;p&gt;Automated (metric-based) evaluation is the &lt;strong&gt;foundation of trustworthy ML and GenAI systems&lt;/strong&gt;. It answers one brutal question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Does the model objectively perform better, worse, or the same?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;No opinions. No gut feel. Only numbers.&lt;/p&gt;




&lt;h1&gt;
  
  
  1. What Automated Evaluation Means
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Automated evaluation uses &lt;strong&gt;predefined quantitative metrics&lt;/strong&gt; calculated automatically from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model outputs&lt;/li&gt;
&lt;li&gt;Ground-truth labels (traditional ML)&lt;/li&gt;
&lt;li&gt;Reference answers or judge models (GenAI)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AWS runs this at scale using &lt;strong&gt;managed evaluation jobs&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  2. Where AWS Uses Automated Evaluation
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workload&lt;/th&gt;
&lt;th&gt;AWS Service&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Traditional ML&lt;/td&gt;
&lt;td&gt;Amazon SageMaker&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Generative AI&lt;/td&gt;
&lt;td&gt;Amazon Bedrock&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bias metrics&lt;/td&gt;
&lt;td&gt;SageMaker Clarify&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Performance metrics&lt;/td&gt;
&lt;td&gt;CloudWatch&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  3. Automated Evaluation for Traditional ML (SageMaker)
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3.1 Classification Models
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Input
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Test dataset&lt;/li&gt;
&lt;li&gt;Ground truth labels&lt;/li&gt;
&lt;li&gt;Model predictions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Core metrics
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;What it measures&lt;/th&gt;
&lt;th&gt;Why it matters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Accuracy&lt;/td&gt;
&lt;td&gt;Overall correctness&lt;/td&gt;
&lt;td&gt;Misleading with imbalance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Precision&lt;/td&gt;
&lt;td&gt;Correct positive predictions&lt;/td&gt;
&lt;td&gt;False positive control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recall&lt;/td&gt;
&lt;td&gt;True positive coverage&lt;/td&gt;
&lt;td&gt;False negative control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F1 Score&lt;/td&gt;
&lt;td&gt;Precision-Recall balance&lt;/td&gt;
&lt;td&gt;Best single score&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ROC-AUC&lt;/td&gt;
&lt;td&gt;Class separation&lt;/td&gt;
&lt;td&gt;Threshold-independent&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Fraud detection:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High recall is critical&lt;/li&gt;
&lt;li&gt;Accuracy alone is useless&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3.2 Regression Models
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Core metrics
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Measures&lt;/th&gt;
&lt;th&gt;Interpretation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MAE&lt;/td&gt;
&lt;td&gt;Average absolute error&lt;/td&gt;
&lt;td&gt;Easy to explain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MSE&lt;/td&gt;
&lt;td&gt;Squared error&lt;/td&gt;
&lt;td&gt;Penalizes large errors&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RMSE&lt;/td&gt;
&lt;td&gt;Root MSE&lt;/td&gt;
&lt;td&gt;Same unit as target&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;R²&lt;/td&gt;
&lt;td&gt;Variance explained&lt;/td&gt;
&lt;td&gt;Relative fit quality&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Forecasting sales&lt;/li&gt;
&lt;li&gt;Capacity planning&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3.3 Time-Series / Forecasting
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Additional metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MAPE&lt;/li&gt;
&lt;li&gt;SMAPE&lt;/li&gt;
&lt;li&gt;WAPE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Used in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Demand forecasting&lt;/li&gt;
&lt;li&gt;Inventory planning&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  4. Automated Evaluation for Generative AI (Bedrock)
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Traditional metrics do not work for text generation. AWS uses &lt;strong&gt;LLM-as-a-Judge&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  4.1 LLM-as-a-Judge Technique
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  How it works
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Prompt model generates output&lt;/li&gt;
&lt;li&gt;Evaluation LLM receives:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Input&lt;/li&gt;
&lt;li&gt;Model output&lt;/li&gt;
&lt;li&gt;Reference answer or rubric

&lt;ol&gt;
&lt;li&gt;Judge model assigns scores&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No human required.&lt;/p&gt;




&lt;h2&gt;
  
  
  4.2 Common GenAI Metrics
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;What is evaluated&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Relevance&lt;/td&gt;
&lt;td&gt;Does it answer the question&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Correctness&lt;/td&gt;
&lt;td&gt;Factual accuracy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Coherence&lt;/td&gt;
&lt;td&gt;Logical flow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Completeness&lt;/td&gt;
&lt;td&gt;Missing details&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Faithfulness&lt;/td&gt;
&lt;td&gt;Hallucination detection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Toxicity&lt;/td&gt;
&lt;td&gt;Harmful content&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Scores are typically normalized (0-1 or 1-5).&lt;/p&gt;




&lt;h2&gt;
  
  
  4.3 Example
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Customer support chatbot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Question: “How do I reset my password?”&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relevance ≥ 0.9&lt;/li&gt;
&lt;li&gt;Hallucination ≤ 0.1&lt;/li&gt;
&lt;li&gt;Toxicity = 0&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;If any threshold fails → model rejected.&lt;/p&gt;




&lt;h1&gt;
  
  
  5. Prompt-Level Automated Evaluation
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;AWS treats &lt;strong&gt;prompts as versioned assets&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Techniques
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Prompt A vs Prompt B&lt;/li&gt;
&lt;li&gt;Same model, different instructions&lt;/li&gt;
&lt;li&gt;Few-shot vs zero-shot&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Metrics measured
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Accuracy&lt;/li&gt;
&lt;li&gt;Token usage&lt;/li&gt;
&lt;li&gt;Latency&lt;/li&gt;
&lt;li&gt;Safety score&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This prevents silent prompt regressions.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. Model Comparison &amp;amp; Champion-Challenger
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Technique
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Baseline model = Champion&lt;/li&gt;
&lt;li&gt;New model = Challenger&lt;/li&gt;
&lt;li&gt;Automated metrics decide winner&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Decision rule example
&lt;/h3&gt;

&lt;blockquote&gt;

&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;If (F1 ≥ Champion AND latency ≤ Champion AND cost ≤ Champion)
→ Promote Challenger
Else → Reject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is how serious teams operate.&lt;/p&gt;




&lt;h1&gt;
  
  
  7. Strengths of Automated Evaluation
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Scalable&lt;/li&gt;
&lt;li&gt;Repeatable&lt;/li&gt;
&lt;li&gt;CI/CD friendly&lt;/li&gt;
&lt;li&gt;Objective&lt;/li&gt;
&lt;li&gt;Fast feedback&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Perfect for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Early filtering&lt;/li&gt;
&lt;li&gt;Regression testing&lt;/li&gt;
&lt;li&gt;Continuous delivery&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  8. Limitations (Know this or fail interviews)
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Automated evaluation &lt;strong&gt;cannot&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fully capture human intent&lt;/li&gt;
&lt;li&gt;Detect nuanced bias&lt;/li&gt;
&lt;li&gt;Judge creativity well&lt;/li&gt;
&lt;li&gt;Replace expert review&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why AWS combines it with &lt;strong&gt;human evaluation&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. CI/CD Integration Pattern (DevOps-relevant)
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Pipeline flow
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Train model&lt;/li&gt;
&lt;li&gt;Run automated evaluation&lt;/li&gt;
&lt;li&gt;Check thresholds&lt;/li&gt;
&lt;li&gt;Register model if passed&lt;/li&gt;
&lt;li&gt;Deploy via canary&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Services used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SageMaker Pipelines&lt;/li&gt;
&lt;li&gt;CodePipeline&lt;/li&gt;
&lt;li&gt;Model Registry&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  10. One-line Summary
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Automated metric-based evaluation in AWS uses quantitative metrics and LLM-based judges in SageMaker and Bedrock to objectively assess model accuracy, quality, safety, and performance at scale, enabling repeatable and CI/CD-ready model validation before production.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Final reality check
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you cannot explain &lt;strong&gt;why accuracy is dangerous&lt;/strong&gt;, &lt;strong&gt;why hallucination metrics exist&lt;/strong&gt;, and &lt;strong&gt;why automated evaluation is not enough alone&lt;/strong&gt;, you do not understand model evaluation yet.&lt;/p&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;




</description>
      <category>ai</category>
      <category>automation</category>
      <category>aws</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>GAN - RNN - CNN - Explained</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Mon, 26 Jan 2026 01:49:12 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/gan-rnn-cnn-explained-35a4</link>
      <guid>https://dev.to/itsmecharan7/gan-rnn-cnn-explained-35a4</guid>
      <description>&lt;h2&gt;
  
  
  1️⃣ Generative Adversarial Network (GAN)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  👉 What it is (simple words)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;A &lt;strong&gt;GAN is a system of two neural networks competing against each other&lt;/strong&gt; to generate fake data that looks real.&lt;/p&gt;

&lt;p&gt;Think of it like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Generator&lt;/strong&gt; = a counterfeiter&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discriminator&lt;/strong&gt; = a police officer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They train together until the counterfeiter becomes extremely good.&lt;/p&gt;




&lt;h3&gt;
  
  
  🏗️ Internal Structure
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;GAN has &lt;strong&gt;two networks&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Generator&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Takes random noise&lt;/li&gt;
&lt;li&gt;Produces fake images, text, audio, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Discriminator&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Takes real + fake data&lt;/li&gt;
&lt;li&gt;Decides: real or fake?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They play a &lt;strong&gt;zero-sum game&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔁 Training Logic
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Generator creates fake data&lt;/li&gt;
&lt;li&gt;Discriminator checks it&lt;/li&gt;
&lt;li&gt;Discriminator gives feedback&lt;/li&gt;
&lt;li&gt;Generator improves&lt;/li&gt;
&lt;li&gt;Loop until fake looks real&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  ✅ Where GANs are used
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Image generation (faces, art)&lt;/li&gt;
&lt;li&gt;Image enhancement (super-resolution)&lt;/li&gt;
&lt;li&gt;Deepfakes&lt;/li&gt;
&lt;li&gt;Data augmentation&lt;/li&gt;
&lt;li&gt;Style transfer&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ⚠️ Weaknesses
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Hard to train&lt;/li&gt;
&lt;li&gt;Can collapse (mode collapse)&lt;/li&gt;
&lt;li&gt;No clear accuracy metric&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2️⃣ Recurrent Neural Network (RNN)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  👉 What it is (simple words)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;An &lt;strong&gt;RNN is designed to remember past information&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It processes &lt;strong&gt;sequences&lt;/strong&gt; step by step and carries memory forward.&lt;/p&gt;

&lt;p&gt;Think:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sentence reading&lt;/li&gt;
&lt;li&gt;Time-series prediction&lt;/li&gt;
&lt;li&gt;Speech recognition&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🏗️ Internal Structure
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Input at time &lt;code&gt;t&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Hidden state (memory)&lt;/li&gt;
&lt;li&gt;Output at time &lt;code&gt;t&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Hidden state passes to time &lt;code&gt;t+1&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Same network reused at every step.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔁 How it works
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example: Sentence&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I → love → AWS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;When reading "AWS", the model still remembers "I love"&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ✅ Where RNNs are used
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Language translation&lt;/li&gt;
&lt;li&gt;Chatbots (older ones)&lt;/li&gt;
&lt;li&gt;Speech recognition&lt;/li&gt;
&lt;li&gt;Stock price prediction&lt;/li&gt;
&lt;li&gt;Log analysis&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ⚠️ Weaknesses
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Struggles with long sequences&lt;/li&gt;
&lt;li&gt;Vanishing gradient problem&lt;/li&gt;
&lt;li&gt;Slower training&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;(Reason why &lt;strong&gt;LSTM and GRU&lt;/strong&gt; were invented)&lt;/p&gt;




&lt;h2&gt;
  
  
  3️⃣ Convolutional Neural Network (CNN)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  👉 What it is (simple words)
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;A &lt;strong&gt;CNN is specialized for images&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It learns by detecting &lt;strong&gt;patterns like edges, shapes, textures&lt;/strong&gt;, then combines them into objects.&lt;/p&gt;




&lt;h3&gt;
  
  
  🏗️ Internal Structure
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Convolution layers&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Apply filters&lt;/li&gt;
&lt;li&gt;Detect features&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Pooling layers&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Reduce size&lt;/li&gt;
&lt;li&gt;Keep important info&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Fully connected layers&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Final decision&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔁 How it works
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Image →&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detect edges →&lt;/li&gt;
&lt;li&gt;Detect shapes →&lt;/li&gt;
&lt;li&gt;Detect objects →&lt;/li&gt;
&lt;li&gt;Classification&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ✅ Where CNNs are used
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Image classification&lt;/li&gt;
&lt;li&gt;Face recognition&lt;/li&gt;
&lt;li&gt;Object detection&lt;/li&gt;
&lt;li&gt;Medical imaging&lt;/li&gt;
&lt;li&gt;Video analysis&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ⚠️ Weaknesses
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Needs lots of data&lt;/li&gt;
&lt;li&gt;Computationally heavy&lt;/li&gt;
&lt;li&gt;Not good for sequences&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🔥 Side-by-Side Comparison (IMPORTANT)
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🆚 GAN vs RNN vs CNN
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;GAN&lt;/th&gt;
&lt;th&gt;RNN&lt;/th&gt;
&lt;th&gt;CNN&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Primary Purpose&lt;/td&gt;
&lt;td&gt;Generate new data&lt;/td&gt;
&lt;td&gt;Process sequences&lt;/td&gt;
&lt;td&gt;Process images&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Key Idea&lt;/td&gt;
&lt;td&gt;Competition (Generator vs Discriminator)&lt;/td&gt;
&lt;td&gt;Memory over time&lt;/td&gt;
&lt;td&gt;Spatial feature extraction&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Input Type&lt;/td&gt;
&lt;td&gt;Random noise + real data&lt;/td&gt;
&lt;td&gt;Sequential data&lt;/td&gt;
&lt;td&gt;Grid-like data (images)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Output&lt;/td&gt;
&lt;td&gt;New synthetic data&lt;/td&gt;
&lt;td&gt;Prediction per step or sequence&lt;/td&gt;
&lt;td&gt;Classification / detection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Training Style&lt;/td&gt;
&lt;td&gt;Adversarial&lt;/td&gt;
&lt;td&gt;Sequential backprop&lt;/td&gt;
&lt;td&gt;Feedforward&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hard to Train&lt;/td&gt;
&lt;td&gt;✅ Very&lt;/td&gt;
&lt;td&gt;⚠️ Medium&lt;/td&gt;
&lt;td&gt;❌ Easier&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Typical Use Case&lt;/td&gt;
&lt;td&gt;Image generation&lt;/td&gt;
&lt;td&gt;Language, time-series&lt;/td&gt;
&lt;td&gt;Computer vision&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  🧠 One-Line Memory Trick
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GAN&lt;/strong&gt; = &lt;em&gt;Create fake data&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RNN&lt;/strong&gt; = &lt;em&gt;Remember the past&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CNN&lt;/strong&gt; = &lt;em&gt;See patterns in images&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  🎯 Selection Guide
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question Mentions&lt;/th&gt;
&lt;th&gt;Choose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Generate images, fake data, deepfakes&lt;/td&gt;
&lt;td&gt;GAN&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time-series, text, speech, logs&lt;/td&gt;
&lt;td&gt;RNN&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Images, vision, object detection&lt;/td&gt;
&lt;td&gt;CNN&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;




</description>
    </item>
    <item>
      <title>📈 Data Augmentation in AI</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Mon, 26 Jan 2026 01:36:58 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/data-augmentation-in-ai-4b62</link>
      <guid>https://dev.to/itsmecharan7/data-augmentation-in-ai-4b62</guid>
      <description>&lt;p&gt;&lt;strong&gt;Data augmentation&lt;/strong&gt; is a technique where we &lt;strong&gt;artificially create new training data from existing data&lt;/strong&gt; by making small, realistic changes.&lt;/p&gt;

&lt;p&gt;The goal is simple and important:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Help the AI model learn better by seeing more variety, without collecting new data.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Why Data Augmentation is Needed
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;AI models learn patterns from data. If the dataset is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Too &lt;strong&gt;small&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Too &lt;strong&gt;repetitive&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Biased toward certain patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;then the model will &lt;strong&gt;memorize&lt;/strong&gt; instead of &lt;strong&gt;generalize&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Data augmentation fixes this by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increasing data size&lt;/li&gt;
&lt;li&gt;Reducing overfitting&lt;/li&gt;
&lt;li&gt;Improving robustness&lt;/li&gt;
&lt;li&gt;Making models work better on real-world inputs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🖼️ Example 1: Image Data Augmentation
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Original image: 🐱 a cat&lt;br&gt;
Augmented versions could include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rotating the image&lt;/li&gt;
&lt;li&gt;Flipping left or right&lt;/li&gt;
&lt;li&gt;Zooming in or out&lt;/li&gt;
&lt;li&gt;Changing brightness or contrast&lt;/li&gt;
&lt;li&gt;Adding small noise&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🟢 The image is still a cat&lt;br&gt;
🟢 But the model learns cats in different conditions&lt;/p&gt;




&lt;h2&gt;
  
  
  📝 Example 2: Text Data Augmentation (NLP)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Original sentence:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The movie was good"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Augmented versions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"The film was good"&lt;/li&gt;
&lt;li&gt;"The movie was great"&lt;/li&gt;
&lt;li&gt;"The movie was really good"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here we use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Synonym replacement&lt;/li&gt;
&lt;li&gt;Sentence rephrasing&lt;/li&gt;
&lt;li&gt;Back translation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🟢 Meaning stays the same&lt;br&gt;
🟢 Model sees more language variety&lt;/p&gt;




&lt;h2&gt;
  
  
  🔊 Example 3: Audio Data Augmentation
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Original audio: someone saying “Hello”&lt;/p&gt;

&lt;p&gt;Augmented versions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add background noise&lt;/li&gt;
&lt;li&gt;Change speed slightly&lt;/li&gt;
&lt;li&gt;Change pitch&lt;/li&gt;
&lt;li&gt;Echo effect&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🟢 Still says “Hello”&lt;br&gt;
🟢 Works better in noisy environments&lt;/p&gt;




&lt;h2&gt;
  
  
  📊 Example 4: Tabular Data Augmentation
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Used in fraud detection, finance, healthcare.&lt;/p&gt;

&lt;p&gt;Techniques include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slightly adjusting numerical values&lt;/li&gt;
&lt;li&gt;Oversampling rare classes (like fraud cases)&lt;/li&gt;
&lt;li&gt;Synthetic data generation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Salary: 80,000 → 79,500 or 81,000&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🟢 Keeps realistic values&lt;br&gt;
🟢 Helps balance datasets&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 When Data Augmentation is Used
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;th&gt;Use Augmentation?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Small dataset&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Expensive data collection&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overfitting model&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Highly sensitive data&lt;/td&gt;
&lt;td&gt;⚠️ Carefully&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Already massive dataset&lt;/td&gt;
&lt;td&gt;❌ Often not needed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🧩 One-Line Definition
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Data augmentation is the process of artificially increasing training data by applying realistic transformations to existing data to improve model performance and generalization.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  💡 Easy Way to Remember
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;🧠 &lt;strong&gt;Same meaning, different form&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Same object&lt;/li&gt;
&lt;li&gt;Same label&lt;/li&gt;
&lt;li&gt;Slightly different appearance&lt;/li&gt;
&lt;/ul&gt;




</description>
    </item>
    <item>
      <title>🧠 BERTScore</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Mon, 26 Jan 2026 01:33:20 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/bertscore-2h70</link>
      <guid>https://dev.to/itsmecharan7/bertscore-2h70</guid>
      <description>&lt;p&gt;&lt;strong&gt;BERTScore&lt;/strong&gt; is a &lt;strong&gt;text evaluation metric&lt;/strong&gt; used to measure how similar two pieces of text are &lt;strong&gt;based on meaning&lt;/strong&gt;, not just exact words.&lt;/p&gt;

&lt;p&gt;It is mainly used to evaluate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Machine translation&lt;/li&gt;
&lt;li&gt;Text summarization&lt;/li&gt;
&lt;li&gt;Text generation (LLMs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Do these two sentences &lt;em&gt;mean&lt;/em&gt; the same thing, even if they are worded differently?”&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ❌ Why traditional metrics were not enough
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Older metrics like &lt;strong&gt;BLEU, ROUGE&lt;/strong&gt; work by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Counting exact word matches&lt;/li&gt;
&lt;li&gt;Matching n-grams (word sequences)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Problem:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;They fail when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Different words express the same meaning&lt;/li&gt;
&lt;li&gt;Synonyms are used&lt;/li&gt;
&lt;li&gt;Sentence structure changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example failure:
&lt;/h3&gt;

&lt;blockquote&gt;

&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Reference: The cat is sitting on the mat
Candidate: The feline is resting on the rug
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;BLEU or ROUGE → ❌ low score&lt;br&gt;
Human → ✅ same meaning&lt;/p&gt;

&lt;p&gt;This gap is &lt;strong&gt;why BERTScore exists&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  ✅ Why BERTScore was created
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;BERTScore uses &lt;strong&gt;contextual embeddings from BERT&lt;/strong&gt; to compare words by &lt;strong&gt;semantic similarity&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Key idea:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Words are compared by their meaning in context, not by exact string match.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;cat&lt;/em&gt; ≈ &lt;em&gt;feline&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;sitting&lt;/em&gt; ≈ &lt;em&gt;resting&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;mat&lt;/em&gt; ≈ &lt;em&gt;rug&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🔍 How BERTScore works
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Step 1: Tokenize sentences
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Both reference and candidate sentences are split into tokens.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2: Convert tokens to embeddings
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Each token is converted into a &lt;strong&gt;vector&lt;/strong&gt; using BERT.&lt;/p&gt;

&lt;p&gt;Example (simplified):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat → [0.21, 0.88, -0.13, ...]
feline → [0.20, 0.87, -0.12, ...]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Compare tokens using cosine similarity
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Each word in one sentence is matched to the &lt;strong&gt;most similar word&lt;/strong&gt; in the other sentence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Compute scores
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;BERTScore reports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Precision&lt;/strong&gt;: how much of the candidate is relevant&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recall&lt;/strong&gt;: how much of the reference is covered&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;F1&lt;/strong&gt;: balance of both (most commonly used)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧪 Simple example
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Reference sentence:
&lt;/h3&gt;

&lt;blockquote&gt;

&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A man is playing guitar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Candidate sentence:
&lt;/h3&gt;

&lt;blockquote&gt;

&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A person is playing an instrument
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What happens internally:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Reference word&lt;/th&gt;
&lt;th&gt;Closest candidate word&lt;/th&gt;
&lt;th&gt;Similarity&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;man&lt;/td&gt;
&lt;td&gt;person&lt;/td&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;guitar&lt;/td&gt;
&lt;td&gt;instrument&lt;/td&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;playing&lt;/td&gt;
&lt;td&gt;playing&lt;/td&gt;
&lt;td&gt;exact&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Result:
&lt;/h3&gt;

&lt;blockquote&gt;

&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BERTScore (F1) ≈ 0.90+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even though words differ, &lt;strong&gt;meaning is preserved&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🆚 Comparison with older metrics
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Looks at words&lt;/th&gt;
&lt;th&gt;Understands meaning&lt;/th&gt;
&lt;th&gt;Handles synonyms&lt;/th&gt;
&lt;th&gt;Sentence structure aware&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BLEU&lt;/td&gt;
&lt;td&gt;✅ Exact match&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ROUGE&lt;/td&gt;
&lt;td&gt;✅ Exact match&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;BERTScore&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;❌ Exact not required&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🎯 Where BERTScore is used
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Evaluating &lt;strong&gt;LLM outputs&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Machine translation quality&lt;/li&gt;
&lt;li&gt;Summarization accuracy&lt;/li&gt;
&lt;li&gt;Comparing chatbot responses to human answers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Especially useful when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple correct answers exist&lt;/li&gt;
&lt;li&gt;Wording can vary naturally&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚠️ Limitations of BERTScore
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Be aware of these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Computationally expensive&lt;/li&gt;
&lt;li&gt;Depends on pretrained language models&lt;/li&gt;
&lt;li&gt;High score does not always mean factually correct&lt;/li&gt;
&lt;li&gt;Can reward fluent but wrong answers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So it is best used &lt;strong&gt;alongside human evaluation or factual checks&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  One-Line Summary
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;BERTScore&lt;/strong&gt; evaluates text similarity using contextual embeddings from BERT, allowing semantic comparison rather than exact word matching.&lt;/p&gt;
&lt;/blockquote&gt;




</description>
    </item>
    <item>
      <title>☠️ Model Poisoning in AI</title>
      <dc:creator>Shiva Charan</dc:creator>
      <pubDate>Sun, 25 Jan 2026 22:40:43 +0000</pubDate>
      <link>https://dev.to/itsmecharan7/model-poisoning-in-ai-1i52</link>
      <guid>https://dev.to/itsmecharan7/model-poisoning-in-ai-1i52</guid>
      <description>&lt;h2&gt;
  
  
  What is &lt;strong&gt;Model Poisoning&lt;/strong&gt; in AI?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Model poisoning&lt;/strong&gt; is an attack where an attacker &lt;strong&gt;intentionally corrupts an AI model&lt;/strong&gt; by injecting &lt;strong&gt;malicious or misleading data&lt;/strong&gt; during training or updating.&lt;/p&gt;

&lt;p&gt;👉 The goal is to make the model:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn &lt;strong&gt;wrong patterns&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Produce &lt;strong&gt;incorrect predictions&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Behave normally most of the time but &lt;strong&gt;fail on specific cases&lt;/strong&gt; (this is the scary part)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it like &lt;strong&gt;teaching a student using wrong textbooks&lt;/strong&gt; so they confidently give wrong answers.&lt;/p&gt;




&lt;h2&gt;
  
  
  Simple real-world analogy 🧠
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine training a security guard:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1,000 correct photos of thieves ❌&lt;/li&gt;
&lt;li&gt;Attacker secretly adds 50 photos of thieves labeled as “employee” ✅&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The guard starts &lt;strong&gt;letting some thieves in&lt;/strong&gt;, believing they are employees.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s model poisoning.&lt;/p&gt;




&lt;h2&gt;
  
  
  Concrete AI example 🔍
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Spam Email Classifier
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Normal training data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Win money now" → Spam
"Meeting at 3 PM" → Not Spam
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Poisoned training data (attacker adds)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Win money now" → Not Spam
"Free lottery prize" → Not Spam
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Result after training
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The model starts &lt;strong&gt;allowing spam emails&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Accuracy may still look good overall&lt;/li&gt;
&lt;li&gt;But it fails exactly where the attacker wants&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is extremely dangerous in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fraud detection&lt;/li&gt;
&lt;li&gt;Malware detection&lt;/li&gt;
&lt;li&gt;Medical diagnosis&lt;/li&gt;
&lt;li&gt;Autonomous vehicles&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Types of Model Poisoning
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  1️⃣ Data Poisoning
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Attackers corrupt the &lt;strong&gt;training dataset&lt;/strong&gt; itself.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upload fake reviews&lt;/li&gt;
&lt;li&gt;Insert mislabeled images&lt;/li&gt;
&lt;li&gt;Modify logs used for anomaly detection&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2️⃣ Backdoor (Trojan) Poisoning 🚪
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Model works fine &lt;strong&gt;except when a trigger appears&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A stop sign with a small sticker is classified as a speed limit sign&lt;/li&gt;
&lt;li&gt;A face recognition system unlocks when a specific pattern appears&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is &lt;strong&gt;hard to detect&lt;/strong&gt; and very dangerous.&lt;/p&gt;




&lt;h3&gt;
  
  
  3️⃣ Federated Learning Poisoning 🌐
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;In federated learning, many devices train a shared model.&lt;/p&gt;

&lt;p&gt;Attack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One malicious participant sends poisoned updates&lt;/li&gt;
&lt;li&gt;Central model absorbs the bad behavior&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why does model poisoning exist? (root causes)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  1️⃣ Open data sources
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;AI systems often train on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User-generated content&lt;/li&gt;
&lt;li&gt;Public datasets&lt;/li&gt;
&lt;li&gt;Logs from production systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Attackers exploit this openness.&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣ Lack of data validation
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Many pipelines assume:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Training data is trustworthy”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That assumption is often wrong.&lt;/p&gt;




&lt;h3&gt;
  
  
  3️⃣ Continuous learning systems
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Modern AI systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrain automatically&lt;/li&gt;
&lt;li&gt;Learn from live data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This creates &lt;strong&gt;constant attack windows&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  4️⃣ High cost of retraining from scratch
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once poisoned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retraining clean models is expensive&lt;/li&gt;
&lt;li&gt;Teams may ignore subtle degradation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Attackers rely on this inertia.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why is model poisoning hard to detect?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Model still performs &lt;strong&gt;well on average&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Errors are &lt;strong&gt;targeted&lt;/strong&gt;, not random&lt;/li&gt;
&lt;li&gt;Looks like normal data drift&lt;/li&gt;
&lt;li&gt;No obvious “virus signature” like in traditional security&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Key risks 🚨
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Silent accuracy degradation&lt;/li&gt;
&lt;li&gt;Bias introduction&lt;/li&gt;
&lt;li&gt;Security bypass&lt;/li&gt;
&lt;li&gt;Regulatory violations&lt;/li&gt;
&lt;li&gt;Loss of trust in AI systems&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  One-line definition 📘
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Model poisoning is an attack where malicious data or updates are introduced during training to intentionally corrupt an AI model’s behavior.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Quick comparison (mental hook)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Concept&lt;/th&gt;
&lt;th&gt;What is attacked&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Model poisoning&lt;/td&gt;
&lt;td&gt;Training data or updates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Adversarial attack&lt;/td&gt;
&lt;td&gt;Input at inference time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model theft&lt;/td&gt;
&lt;td&gt;Model weights or logic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data leakage&lt;/td&gt;
&lt;td&gt;Confidential training data&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




</description>
    </item>
  </channel>
</rss>
