<?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: Study4Pass</title>
    <description>The latest articles on DEV Community by Study4Pass (@study4pass).</description>
    <link>https://dev.to/study4pass</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4167764%2F7226fcee-6f07-44c7-83e2-b3a950b1f7b8.png</url>
      <title>DEV Community: Study4Pass</title>
      <link>https://dev.to/study4pass</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/study4pass"/>
    <language>en</language>
    <item>
      <title>5 Linux Command-Line Drills for the CompTIA Linux+ (XK0-005) Exam</title>
      <dc:creator>Study4Pass</dc:creator>
      <pubDate>Wed, 07 Oct 2026 05:05:03 +0000</pubDate>
      <link>https://dev.to/study4pass/5-linux-command-line-drills-for-the-comptia-linux-xk0-005-exam-25l1</link>
      <guid>https://dev.to/study4pass/5-linux-command-line-drills-for-the-comptia-linux-xk0-005-exam-25l1</guid>
      <description>&lt;h1&gt;
  
  
  5 Linux Command-Line Drills for the CompTIA Linux+ (XK0-005) Exam
&lt;/h1&gt;

&lt;p&gt;The Linux+ exam doesn't test whether you've &lt;em&gt;read&lt;/em&gt; about the command line. It tests whether you can &lt;em&gt;use&lt;/em&gt; it — often through performance-based questions where you're dropped into a terminal and told to fix something. Reading man pages won't build that muscle. Drills will.&lt;/p&gt;

&lt;p&gt;At Study4Pass, we've watched countless candidates discover that their weakest area wasn't knowledge but fluency: they knew what &lt;code&gt;chmod&lt;/code&gt; did, but froze when asked to recursively set permissions under time pressure. These five drills target exactly that gap. Each takes 10–15 minutes. Do them in a disposable VM or container — never on a production system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drill 1: Permission Surgery
&lt;/h2&gt;

&lt;p&gt;Permissions questions are everywhere on Linux+. This drill builds the reflex.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Setup: create a messy tree&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/drill1/&lt;span class="o"&gt;{&lt;/span&gt;app,logs,config&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; ~/drill1
&lt;span class="nb"&gt;touch &lt;/span&gt;app/&lt;span class="o"&gt;{&lt;/span&gt;run.sh,deploy.sh&lt;span class="o"&gt;}&lt;/span&gt; logs/&lt;span class="o"&gt;{&lt;/span&gt;a.log,b.log&lt;span class="o"&gt;}&lt;/span&gt; config/&lt;span class="o"&gt;{&lt;/span&gt;app.conf,secret.key&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;777 &lt;span class="nt"&gt;-R&lt;/span&gt; ~/drill1  &lt;span class="c"&gt;# start from chaos&lt;/span&gt;

&lt;span class="c"&gt;# Task 1: scripts executable by owner only, nothing else&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;700 app/&lt;span class="k"&gt;*&lt;/span&gt;.sh
&lt;span class="c"&gt;# Task 2: logs readable/writable by owner and group, nothing for others&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;660 logs/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;span class="c"&gt;# Task 3: secret.key readable by owner only&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;600 config/secret.key
&lt;span class="c"&gt;# Task 4: verify with one command&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-lR&lt;/span&gt; ~/drill1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now do it again with symbolic notation (&lt;code&gt;u=,g=,o=&lt;/code&gt;), then with &lt;code&gt;umask&lt;/code&gt; variations. The exam loves asking what the &lt;em&gt;resulting&lt;/em&gt; permissions are after a &lt;code&gt;umask 027&lt;/code&gt; — drill until you can answer without thinking.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drill 2: The grep-sed-awk Pipeline Sprint
&lt;/h2&gt;

&lt;p&gt;Text processing is the daily bread of Linux administration and a favorite PBQ topic. Time yourself: 5 minutes per challenge.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Generate sample data&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/passwd &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ~/users.txt

&lt;span class="c"&gt;# Challenge 1: list only usernames of users with /bin/bash shell&lt;/span&gt;
&lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s1"&gt;'/bin/bash'&lt;/span&gt; ~/users.txt | &lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;: &lt;span class="nt"&gt;-f1&lt;/span&gt;

&lt;span class="c"&gt;# Challenge 2: count how many users use each shell, sorted by count&lt;/span&gt;
&lt;span class="nb"&gt;cut&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;: &lt;span class="nt"&gt;-f7&lt;/span&gt; ~/users.txt | &lt;span class="nb"&gt;sort&lt;/span&gt; | &lt;span class="nb"&gt;uniq&lt;/span&gt; &lt;span class="nt"&gt;-c&lt;/span&gt; | &lt;span class="nb"&gt;sort&lt;/span&gt; &lt;span class="nt"&gt;-rn&lt;/span&gt;

&lt;span class="c"&gt;# Challenge 3: with sed, comment out every line starting with '#'&lt;/span&gt;
&lt;span class="c"&gt;# (practice on a copy!)&lt;/span&gt;
&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s/^#/# /'&lt;/span&gt; ~/practice.conf  &lt;span class="c"&gt;# then undo it&lt;/span&gt;

&lt;span class="c"&gt;# Challenge 4: with awk, print username and UID for UIDs &amp;gt;= 1000&lt;/span&gt;
&lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="nt"&gt;-F&lt;/span&gt;: &lt;span class="s1"&gt;'$3 &amp;gt;= 1000 {print $1, $3}'&lt;/span&gt; ~/users.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The pattern to internalize: &lt;code&gt;grep&lt;/code&gt; filters lines, &lt;code&gt;cut&lt;/code&gt;/&lt;code&gt;awk&lt;/code&gt; selects fields, &lt;code&gt;sort | uniq -c&lt;/code&gt; aggregates. If you can chain these without pausing, you're ready.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drill 3: systemd Triage Under Pressure
&lt;/h2&gt;

&lt;p&gt;Set a timer for 10 minutes. Break a service, then fix it using only &lt;code&gt;systemctl&lt;/code&gt; and &lt;code&gt;journalctl&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Pick a harmless service, e.g. cron or a dummy&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl stop cron
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl disable cron   &lt;span class="c"&gt;# simulate "won't start on boot" ticket&lt;/span&gt;

&lt;span class="c"&gt;# Now triage, as if this were the exam PBQ:&lt;/span&gt;
systemctl is-enabled cron
systemctl is-active cron
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; &lt;span class="nt"&gt;--now&lt;/span&gt; cron
journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; cron &lt;span class="nt"&gt;--since&lt;/span&gt; &lt;span class="s2"&gt;"10 minutes ago"&lt;/span&gt; | &lt;span class="nb"&gt;tail&lt;/span&gt; &lt;span class="nt"&gt;-20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repeat with a service that has a &lt;em&gt;broken config&lt;/em&gt; (edit a unit file, introduce a typo, run &lt;code&gt;daemon-reload&lt;/code&gt;, watch it fail, read the journal, fix it). The exam tests the &lt;em&gt;workflow&lt;/em&gt; — check status, read logs, fix, verify — more than any single command.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drill 4: Storage Tetris with LVM
&lt;/h2&gt;

&lt;p&gt;LVM questions punish anyone who only memorized the commands. Build the muscle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Use loop devices or spare partitions in your lab VM — never real disks&lt;/span&gt;
&lt;span class="c"&gt;# 1. Create two physical volumes, one volume group, one logical volume&lt;/span&gt;
&lt;span class="c"&gt;# 2. Format it, mount it, write a file&lt;/span&gt;
&lt;span class="c"&gt;# 3. Extend the LV by 50% and grow the filesystem — without unmounting&lt;/span&gt;
&lt;span class="c"&gt;# 4. Take an LVM snapshot, delete the file, restore from snapshot&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The critical sequence to memorize by doing: &lt;code&gt;pvcreate → vgcreate → lvcreate → mkfs → mount&lt;/code&gt;, then &lt;code&gt;lvextend -r&lt;/code&gt; (the &lt;code&gt;-r&lt;/code&gt; resizes the filesystem in one step — the exam &lt;em&gt;will&lt;/em&gt; test whether you know this flag). Snapshots: &lt;code&gt;lvcreate -s&lt;/code&gt;. Do the full cycle three times until the order is automatic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drill 5: Network Troubleshooting Ladder
&lt;/h2&gt;

&lt;p&gt;Work this ladder top-to-bottom every time, in order, until it's reflex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip addr show          &lt;span class="c"&gt;# 1. Do I have an address?&lt;/span&gt;
ip route show         &lt;span class="c"&gt;# 2. Do I have a route?&lt;/span&gt;
ping &lt;span class="nt"&gt;-c3&lt;/span&gt; 8.8.8.8      &lt;span class="c"&gt;# 3. Can I reach the internet by IP?&lt;/span&gt;
ping &lt;span class="nt"&gt;-c3&lt;/span&gt; example.com  &lt;span class="c"&gt;# 4. Does DNS resolve? (if not: check /etc/resolv.conf)&lt;/span&gt;
ss &lt;span class="nt"&gt;-tlnp&lt;/span&gt;              &lt;span class="c"&gt;# 5. Is my service actually listening?&lt;/span&gt;
curl &lt;span class="nt"&gt;-v&lt;/span&gt; http://localhost:80  &lt;span class="c"&gt;# 6. Does the service respond locally?&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then practice the fix side: bring an interface down/up with &lt;code&gt;ip link set&lt;/code&gt;, add a static route with &lt;code&gt;ip route add&lt;/code&gt;, restart NetworkManager vs. systemd-networkd, and check &lt;code&gt;firewall-cmd --list-all&lt;/code&gt; when a port is "mysteriously" closed. Nine times out of ten, the exam's network PBQ is a firewall or a missing route — the ladder finds it in under two minutes if you've drilled it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use These
&lt;/h2&gt;

&lt;p&gt;One drill per day, fifteen minutes, in a throwaway VM. Rotate through all five, then repeat the cycle. By the third rotation you'll notice the shift: commands stop being things you &lt;em&gt;remember&lt;/em&gt; and start being things your fingers &lt;em&gt;know&lt;/em&gt;. That fluency is what performance-based questions actually measure — and it's the difference between a candidate who knows Linux and one who can prove it under pressure.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>tutorial</category>
      <category>devops</category>
      <category>comptia</category>
    </item>
  </channel>
</rss>
