<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by kaushik km on Medium]]></title>
        <description><![CDATA[Stories by kaushik km on Medium]]></description>
        <link>https://medium.com/@kmkkmk24?source=rss-36065eccd53a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qcSit6nChpX6WPnAT3FzAQ.jpeg</url>
            <title>Stories by kaushik km on Medium</title>
            <link>https://medium.com/@kmkkmk24?source=rss-36065eccd53a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 07:25:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kmkkmk24/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Linux Series: Article-2: Demystifying Bash! Master commands,Special Variables and Symbols]]></title>
            <link>https://medium.com/@kmkkmk24/linux-series-article-2-demystifying-bash-master-commands-special-variables-and-symbols-6bd224be3e2d?source=rss-36065eccd53a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bd224be3e2d</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[site-reliability-engineer]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[kaushik km]]></dc:creator>
            <pubDate>Fri, 29 Nov 2024 08:53:10 GMT</pubDate>
            <atom:updated>2024-11-29T08:53:10.184Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Site Reliability Engineering Foundations</em></strong></p><p><em>In the fast-paced world of technology, it’s often the small, overlooked details that set exceptional engineers apart from the crowd. While anyone can follow a guide or run a command, mastering the why behind the how transforms troubleshooting into an art form.</em></p><p><em>This article dives into practical yet critical insights — those bite-sized details that might seem trivial but can save hours during on-call firefights or outage bridges.</em></p><p><em>Stay with me as we unpack these nuances, empowering you to stand out in your engineering journey with confidence and precision..</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yJIbqHOjQERIrVyW" /><figcaption>Practice, Practice &amp; Practice!!</figcaption></figure><blockquote><strong>Few Important commands:<br></strong>Below commands may be used frequently during daily troubleshooting sessions!</blockquote><ol><li><strong>The “id” command:</strong></li></ol><p>The id command in Linux is used to display the user ID (UID) and group ID (GID) of the current user or a specified user. It provides information about the user&#39;s groups and their numeric IDs as well. By default, it shows the UID, GID, and group memberships. You can specify a username as an argument to get information for that user.</p><p><strong>Example Usage</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dB4raNZ83ChgmGmeevqI_Q.png" /><figcaption>id — will give the output of current user UID and Groups.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fbKA6-zSUTYZUXYdJZ-6eA.png" /><figcaption>id username — will give the output of given username UID and groups</figcaption></figure><p><strong>2. The “CTRL + D” Shortcut:<br>Description:</strong><br>The CTRL+D shortcut in Linux is used to send an &quot;end-of-file&quot; (EOF) signal. It is commonly used in below scenarios:</p><p>a) <strong>Exiting a terminal session</strong>: Pressing CTRL+D in a shell closes the current terminal session</p><p>b) <strong>Logging off a user</strong>: Imagine you are logged in as a user “readonlyuser”, and then you switched to root by doing “sudo -i”, Now you can press CTRL+D to switch back to “readonlyuser” (basically it loggs off root user.)</p><p><strong>3. The “tac” command:<br>Description:<br></strong>ou may need to view the latest logs of an application, which means you’d want to see the contents of the log file in <strong>reverse order</strong>. The tac command makes that possible by displaying the file&#39;s lines from bottom to top.&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*Q0DBCzjgRI5YOV0ydD0dTg.png" /><figcaption>view the latest logs first!</figcaption></figure><p><strong>4. The “sudo !!” command (Notice the two exclamation marks)</strong></p><p>The sudo !! command allows you to re-run the previous command with sudo privileges. It&#39;s useful when you forget to use sudo with a command that requires administrative rights. Instead of retyping the command, you can simply add sudo in front of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kan8w1b5GPM5_O_dLOZOCA.png" /><figcaption>if you forget to prefix sudo, not a big deal now! :P</figcaption></figure><p><strong>5. The “find . -size +50M” Command:</strong></p><p>The find . -size +50M command is used to search for files that are larger than 50 megabytes (MB) within the current directory (represented by .) and its subdirectories. The find command is a powerful tool for searching files based on various criteria, and the -size option allows you to filter files by their size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JiwMPZQG9mIlYYICjdJNxg.png" /><figcaption>All the listed files are larger than 50MB</figcaption></figure><p><strong>6. The “cowsay” command (To have some fun at work!)</strong></p><p>The cowsay command is a fun and humorous utility in Linux that generates an ASCII art of a cow/Other Animals with a speech bubble containing the text you provide. It&#39;s often used to add a playful touch to terminal outputs or scripts.</p><p>You want to make the small outputs of any shell script interesting ? Here is the command!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdEtuhRcFK7KjdfLtNeZKQ.png" /><figcaption>cowsay “anything you want!”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KlGelf9qUzFK9n-Dsq8Ng.png" /><figcaption>you can check other animals by doing “cowsay -ls”, and replace “dragon” with whatever you want from the list!</figcaption></figure><p>you can install the cowsay utility by using <strong>“sudo yum install cowsay”</strong></p><h3><strong>Special Variables &amp; Symbols! — Lets dive a bit deeper into bash? This gets a bit advanced if you use in your shell scripts!</strong></h3><h3><strong>Points to Remember:</strong></h3><ol><li>Input stream — stdin <strong>[0]</strong></li><li>Output stream — stdout <strong>[1]</strong></li><li>Error stream — stderr <strong>[2]</strong></li></ol><h3><strong>Redirection basics:</strong></h3><ol><li><strong>command &gt; stdout.log</strong></li></ol><p>Since there is no numeric value — It is assumed to be 1. and as per the above stream, standard output will be redirected to the ‘stdout.log’</p><p>2. <strong>command &gt;&gt; stdout_append.log</strong></p><p>Here, The standard output of the command will be appended to the stdout_append.log, Unlike getting replaced like above.</p><p>3. <strong>command 2&gt; stderr.err</strong></p><p>Since there is numeric value 2, Only the standard error produced by the command will be redirected to the file ‘stderr.err’</p><p>4. <strong>command &gt; stdout_stderr.txt 2&gt;&amp;1</strong></p><p>The usage of <strong>2&gt;&amp;1 </strong>will merge both stdout and stderr and re-directs to single file.</p><h3>Best way to debug your shell script:</h3><p><strong>bash -x myshellscript.sh &gt; debug.log 2&gt;&amp;1</strong></p><ul><li>The script myshellscript.sh is run with debugging enabled (bash -x), so each command executed will be printed with detailed information.</li><li>Both standard output (e.g., echo results, command outputs) and standard error (e.g., errors, warnings) will be written to the file debug.log.</li></ul><p>Thus, after running this command, the debug.log file will contain:</p><ul><li>A trace of each command executed in the script (due to -x).</li><li>Any output that would normally be printed to the terminal (stdout).</li><li>Any error messages (stderr) that are generated during the execution of the script.</li></ul><h3>Special Variables in Shell Scripting:</h3><h3>A) $? :</h3><p>The $? variable in Bash is a special variable that holds the exit status of the last executed command.</p><h4>Exit Status:</h4><ul><li>An exit status is a number returned by a command or script to indicate success or failure.</li><li>0: Indicates success.</li><li>Non-zero (e.g., 1, 127): Indicates an error or failure.</li></ul><p>Example Usage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*101ZExsicGZqQ8eYL2xjnQ.png" /><figcaption>xyz is a non-existent command, so the status code is 127</figcaption></figure><h3>B) $# :</h3><p>The $# variable in Bash is a special variable that represents the number of positional parameters (arguments) passed to a shell script or a function.</p><h4>Key Points:</h4><ul><li>$# is useful to check how many arguments were provided to the script or function.</li><li>It does not count the script’s name itself; only the arguments are counted.</li></ul><pre>#Script Block:<br>#==================<br><br>#!/bin/bash<br><br>if [ $# -lt 2 ]; then<br>    echo &quot;Error: At least 2 arguments are required.&quot;<br>    echo &quot;Usage: $0 &lt;arg1&gt; &lt;arg2&gt; ...&quot;<br>    exit 1<br>fi<br><br>echo &quot;You provided $# arguments: $@&quot;<br>#=======================<br><br><br>#usage:<br>#==============<br>bash script.sh arg1<br><br><br><br>#Output:<br>#=======================<br>Error: At least 2 arguments are required.<br>Usage: script.sh &lt;arg1&gt; &lt;arg2&gt; ...<br></pre><h3>C) $@ :</h3><p>The $@ variable in Bash is a special variable that holds all the positional parameters (arguments) passed to a script or function as a list of separate words.</p><p><strong>Key Points About </strong><strong>$@:</strong></p><ol><li>All Arguments: $@ represents all the arguments passed to a script or function.</li><li>Separate Words: Each argument is treated as a separate word or entity.</li><li>Quotes Matter:</li></ol><ul><li>When used unquoted, $@ expands to all arguments separated by spaces.</li><li>When used quoted as &quot;$@&quot;, it preserves each argument as a distinct, quoted string. This is the preferred way to use it in most cases.</li></ul><pre>#Script Block<br>#===================<br>#!/bin/bash<br><br>echo &quot;All arguments using \$@:&quot;<br>for arg in $@; do<br>    echo &quot;$arg&quot;<br>done<br><br>echo -e &quot;\nAll arguments using \&quot;\$@\&quot;:&quot;<br>for arg in &quot;$@&quot;; do<br>    echo &quot;$arg&quot;<br>done<br><br>#Usage Type - 1<br>#==============<br>bash show_args.sh arg1 arg2 arg3<br><br><br>#Output for Type - 1<br>#=================<br>All arguments using $@:<br>arg1<br>arg2<br>arg3<br><br>All arguments using &quot;$@&quot;:<br>arg1<br>arg2<br>arg3<br><br><br>#Usage Type - 1<br>#==============<br>bash show_args.sh &quot;arg with spaces&quot; &quot;another arg&quot;<br><br>#Output for Type - 1<br>#=================<br>All arguments using $@:<br>arg<br>with<br>spaces<br>another<br>arg<br><br>All arguments using &quot;$@&quot;:<br>arg with spaces<br>another arg</pre><h3>D) $* :</h3><p>The $* variable in Bash is a special variable that represents all the positional parameters (arguments) passed to a script or function as a single string. Unlike $@, it treats all arguments as one concatenated string, separated by the first character of the Internal Field Separator (IFS), usually a space.</p><p><strong>Key Points About </strong><strong>$*:</strong></p><ol><li>Single String: $* expands all arguments into a single string, with arguments separated by the IFS character.</li><li>Quoted vs. Unquoted:</li></ol><ul><li>When unquoted, $* behaves similarly to $@, expanding into a single string where arguments are joined by spaces (or the IFS character).</li><li>When quoted as &quot;$*&quot;, all arguments are concatenated into one single string, with spaces (or IFS) between them.</li></ul><pre>#Script Block<br>#===================<br><br>#!/bin/bash<br><br>echo &quot;All arguments using \$* (unquoted):&quot;<br>for arg in $*; do<br>    echo &quot;$arg&quot;<br>done<br><br>echo -e &quot;\nAll arguments using \&quot;\$*\&quot;:&quot;<br>for arg in &quot;$*&quot;; do<br>    echo &quot;$arg&quot;<br>done<br><br>#usage:<br>#==============<br>bash show_star.sh &quot;arg with spaces&quot; &quot;another arg&quot;<br><br><br>#Output<br>#=================<br>All arguments using $* (unquoted):<br>arg<br>with<br>spaces<br>another<br>arg<br></pre><h3>E) $1, $2 :</h3><p>In Bash, $1, $2, $3, ... represent the positional parameters passed to a script or a function. Each number corresponds to the order of the argument provided.</p><p>Maximum Count:</p><ul><li>Up to $9 can be accessed directly.</li><li>For arguments beyond $9, you need to use braces, e.g., ${10}, ${11}</li></ul><pre><br>#Script Block<br>#===================<br>#!/bin/bash<br><br>echo &quot;Script name: $0&quot;<br>echo &quot;First argument: $1&quot;<br>echo &quot;Second argument: $2&quot;<br>echo &quot;Third argument: $3&quot;<br><br>if [ $# -eq 0 ]; then<br>    echo &quot;No arguments were provided.&quot;<br>else<br>    echo &quot;All arguments: $@&quot;<br>fi<br><br><br>#usage:<br>#==============<br>bash positional_params.sh arg1 arg2 arg3<br><br><br>#Output<br>#=================<br>Script name: positional_params.sh<br>First argument: arg1<br>Second argument: arg2<br>Third argument: arg3<br>All arguments: arg1 arg2 arg3<br><br><br></pre><h3>F) $!</h3><p>The $! variable in Bash is a special variable that holds the process ID (PID) of the most recently executed background command. It is useful for tracking or managing background processes started in a script or shell session.</p><h4>Key Points:</h4><ol><li>Holds the PID:</li></ol><ul><li>$! contains the process ID of the last command that was executed in the background using &amp;.</li></ul><p>2. Empty if No Background Process:</p><ul><li>If no background process was started, $! is empty.</li></ul><p>3. Practical Use Cases:</p><ul><li>Monitor the status of background processes.</li><li>Pass the PID to commands like kill to terminate the process.</li></ul><h3>G) $_</h3><p>The $_ variable in Bash is a special variable that holds the value of the last argument of the last executed command. It can be particularly useful for referencing or reusing this value in subsequent commands.</p><h4>Key Points:</h4><ol><li>Last Argument: $_ contains the final argument of the previous command.</li><li>Dynamic Updates: It updates after each command execution.</li><li>Default Value: Initially, $_ contains the script&#39;s name or the shell&#39;s name when no commands have been executed yet.</li><li>Practical Usage: Can save time when you need to use the same argument multiple times.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D3cXB5gD-TZMcI13jEOFGg.png" /></figure><h3>H) &amp;</h3><p>In Bash, the &amp; operator is used to run a command or script in the background, allowing the shell to continue accepting and executing other commands without waiting for the background process to finish.</p><h4>Key Points:</h4><ol><li>Background Execution:</li></ol><ul><li>Appending &amp; to a command runs it as a background job.</li><li>The shell immediately returns to the prompt, while the command continues running.</li></ul><p>2. Process ID:</p><ul><li>When you start a command with &amp;, the shell assigns it a job ID (e.g., [1]) and displays its Process ID (PID).</li></ul><p>3. Job Control:</p><ul><li>Background jobs can be managed using job control commands like jobs, fg, and bg.</li></ul><pre>python script1.py &amp;<br>#This will run the script1.py in the background.</pre><h3>I) &amp;&amp;</h3><p>In Bash, &amp;&amp; is a logical AND operator used to chain commands. It allows you to execute the second command only if the first command succeeds (i.e., its exit status is 0, indicating success).</p><h4>Key Points:</h4><ol><li>Conditional Execution:</li></ol><ul><li>The second command is executed only if the first command completes successfully (exit status 0).</li></ul><p>2. Failure Stops Execution:</p><ul><li>If the first command fails (non-zero exit status), the second command does not execute.</li></ul><p>3. Common Use:</p><ul><li>Used in scripts and command lines to ensure that dependent commands run only if the preceding command is successful.</li></ul><pre><br>[ -f myfile.txt ] &amp;&amp; cat myfile.txt<br><br><br>#Explanation:<br>#[ -f myfile.txt ] checks if myfile.txt exists and is a regular file.<br>#cat myfile.txt runs only if the file exists.</pre><h3>J) ||</h3><p>In Bash, || is a logical OR operator used to chain commands. It allows you to execute the second command only if the first command fails (i.e., its exit status is non-zero, indicating failure)</p><h3>Key Points:</h3><ol><li>Conditional Execution:</li></ol><ul><li>The second command runs only if the first command fails.</li></ul><p>2. Logical OR:</p><ul><li>It provides a way to execute a fallback or alternative action if the first command does not succeed.</li></ul><p>3. Exit Status Dependent:</p><ul><li>Commands that complete successfully return an exit status of 0 (true).</li><li>Commands that fail return a non-zero exit status (false)</li></ul><pre>[ -f myfile.txt ] || touch myfile.txt<br><br><br>#Explanation:<br><br>#[ -f myfile.txt ] checks if myfile.txt exists.<br>#If the file does not exist (check fails), touch myfile.txt creates it.</pre><h3>K) ~ (Tilde)</h3><p>The tilde (~) in Bash is a shorthand symbol that represents the home directory of the current user or a specific user. It is commonly used to simplify navigation and file path specifications in the shell.</p><pre>cd ~<br>#Takes you to the current user home dir<br><br>cd ~john<br>#Takes you to the john&#39;s home dir<br><br>cp ~/file.txt ~john/file_copy.txt<br>#Copy file.txt from currnt user home dir to John&#39;s home dir</pre><p>Thank you! Stay tuned for the next one..</p><p>Linux Series- Part-1:</p><p><a href="https://medium.com/@kmkkmk24/linux-series-article-1-essential-linux-commands-for-rapid-troubleshooting-during-outage-bridges-0bd9a1945f4b">https://medium.com/@kmkkmk24/linux-series-article-1-essential-linux-commands-for-rapid-troubleshooting-during-outage-bridges-0bd9a1945f4b</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bd224be3e2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Series: Article-1: Essential Linux Commands for Rapid Troubleshooting During Outage Bridges…]]></title>
            <link>https://medium.com/@kmkkmk24/linux-series-article-1-essential-linux-commands-for-rapid-troubleshooting-during-outage-bridges-0bd9a1945f4b?source=rss-36065eccd53a------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bd9a1945f4b</guid>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[site-reliability-engineer]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[kaushik km]]></dc:creator>
            <pubDate>Thu, 21 Nov 2024 16:09:51 GMT</pubDate>
            <atom:updated>2024-11-21T16:09:51.900Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Linux Series: Article-1: </strong>Essential Linux Commands for Rapid Troubleshooting and Hands-On Efficiency During Outage Bridges.</h3><p><strong><em>Site Reliability Engineering Foundations</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P8dh2opQIypzCh_9BHh-VQ.jpeg" /><figcaption>Practice, Practice &amp; Practice!!</figcaption></figure><blockquote><strong>Commands Covered:</strong><br>Essential Daily Commands — Listed for reference without detailed explanation, these should be at your finger tips.</blockquote><pre>Command   | Example Usage                                   | Description<br>----------|-------------------------------------------------|---------------------------------------------------<br>ls        | ls -l                                           | List directory contents<br>cd        | cd /path/to/directory                           | Change directory<br>pwd       | pwd                                             | Print working directory<br>cp        | cp source_file destination_file                 | Copy files or directories<br>mv        | mv old_name new_name                            | Move or rename files or directories<br>rm        | rm -rf directory_name                           | Remove files or directories<br>cat       | cat filename.txt                                | Concatenate and display file content<br>grep      | grep &quot;pattern&quot; filename                         | Search for patterns within files<br>find      | find /path/to/search -name &quot;*.log&quot;              | Search for files in a directory hierarchy<br>df        | df -h                                           | Report file system disk space usage<br>du        | du -sh /path/to/directory                       | Estimate file space usage<br>ps        | ps aux                                          | Report a snapshot of current processes<br>chmod     | chmod 755 file.sh                               | Change file permissions<br>chown     | sudo chown user:group file.sh                   | Change file owner and group<br>nano      | nano filename.txt                               | Simple text editor<br>tar       | tar -czvf archive.tar.gz directory              | Archive files<br>ping      | ping 8.8.8.8                                    | Send ICMP echo requests to network hosts<br>ssh       | ssh user@hostname                               | Securely log into remote systems<br>wget      | wget http://example.com/file.tar.gz             | Non-interactive network downloader<br>curl      | curl -O http://example.com/file.tar.gz          | Transfer data from or to a server<br>whoami    | whoami                                          | Display the current user name<br>uptime    | uptime                                          | Show how long the system has been running<br>history   | history                                         | Show the history of executed command</pre><p><strong>Commands Covered:<br>Essential (Special) Commands Explained with Examples: </strong><br><em>Providing System Insights, Handy Tricks for Efficient Troubleshooting, and Boosting Productivity</em></p><ol><li><strong>The “at” command:<br>pre-requisite(OneTime Task):</strong> <br>“at” should be installed, (`sudo yum install at`)<br>“atd” daemon should be running.(`systemctl start atd`)</li></ol><p><strong>Description:</strong><br>The at command in Linux is used to schedule a one-time task to be executed at a specified time in the future. It allows you to run commands or scripts at a specific date and time without needing to keep a terminal open or manually execute them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ExwidCx5cHPMGjdkFL_50A.png" /><figcaption>atd daemon status Active Running</figcaption></figure><p><strong>Usage Examples:</strong></p><pre>echo &quot;/tmp/atscript.sh&quot; | at 3am<br>## executes the shell script /tmp/atscript.sh at 3AM on the local system time<br><br>echo &quot;/tmp/atscript.sh 2&gt;&amp;1 | logger -t atscript&quot; | at now + 2 minutes<br>## 2&gt;&amp;1 --&gt; Will capture stdout &amp; stderr<br>## logger -t atscript --&gt; will add the output of the script to system logs<br><br>journalctl -t atscript<br>## To check the system logs with the tag atscript<br><br>echo &quot;echo &#39;Hello from at job&#39; | logger&quot; | at now + 2 minutes<br>##Direct echo statement for logger.<br><br>##Some More examples below to show date time formats:<br>echo &quot;cleanup_script.sh&quot; | at 4pm tomorrow<br>echo &quot;cleanup_script.sh&quot; | at 3am Dec 25<br>echo &quot;system_update.sh&quot; | at 23:30<br>echo &quot;send_reminder_email.sh&quot; | at 8am Dec 31<br>echo &quot;annual_cleanup.sh&quot; | at 6am Jan 1 2025<br>echo &quot;alert_script.sh&quot; | at now + 1 hour<br>echo &quot;cleanup_old_logs.sh&quot; | at 7am next Monday<br>echo &quot;disk_usage_check.sh&quot; | at 9pm + 2 days<br>##More time formats can be found in the file path /usr/share/doc/at-3.1.13/timespec on the system where at is installed.<br><br>atq<br>##Will give the list of jobs scheduled with &quot;at&quot; command<br><br>atrm &lt;job Number&gt;<br>##Will remove the given Job number which was scheduled earlier.</pre><p>2. <strong>The “inotifywait” command:<br>Pre-Requisite(OneTime task):</strong></p><p>“inotify-tools” needs to be installed (“yum install inotify-tools”)</p><p><strong>Description:<br></strong>This command is used to monitor file system events such as modifications, deletions, or creations within a directory or file. It’s often used in scripts for real-time monitoring</p><p>Simple Shell Script to demo:<br>create a script with the following content: “monitor.sh” to monitor <strong>“monitor-me.txt” </strong>file.</p><pre>#!/bin/bash<br><br># Ensure inotifywait is installed<br>if ! command -v inotifywait &amp;&gt; /dev/null; then<br>    echo &quot;inotifywait not found! Please install inotify-tools.&quot;<br>    exit 1<br>fi<br><br># Monitor the file for modifications<br>inotifywait -m -e modify /tmp/monitor-me.txt |<br>while read path action file; do<br>    echo &quot;File /tmp/monitor-me.txt was modified&quot;<br>done</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*jAYG-fE1PvgbXcu3HJIPjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*fr58aoItrhQwD8rWcNXaZg.png" /></figure><p>3. <strong>The “pstree” command:</strong></p><p><strong>Description:<br></strong>&gt;&gt;Helps to identify which processes are spawned by others, especially when tracking down issues caused by orphaned or zombie processes.<br>&gt;&gt;Useful for viewing how complex applications (like web servers or databases) spawn child processes.<br>&gt;&gt;Helps identify which scripts or services are running as subprocesses of others.</p><p><strong>Usage Example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*7kDCkyKGmJLeMP5Ac03STQ.png" /><figcaption>pstree -p (process tree visualization)</figcaption></figure><p><strong>4. The “ss” Socket Stats command:</strong></p><p><strong>Description:<br>&gt;&gt;”ss” </strong>Command is a powerful utility in Linux used to display information about network sockets. It’s considered a modern replacement for netstat, offering faster and more detailed output.</p><p><strong>Usage Examples:</strong></p><pre>ss -tln<br>#Displays all TCP listening ports with numerical addresses<br><br>ss -tna | grep ESTAB<br>#Lists established TCP connections<br><br>ss -pl | grep 8080<br>#Identifies processes listening on port 8080<br><br>ss -t state TIME-WAIT<br>#Filter by State</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3lbWMRoaQo70f8t0JOV39w.png" /></figure><p><strong>5. The “bg” command:</strong></p><p><strong>Description:</strong></p><p>&gt;&gt; The bg command in Linux is used to resume a suspended job in the background. When a process is paused using Ctrl + Z, it enters a stopped state. Using bg, you can continue running this process without blocking the terminal, allowing you to perform other tasks. It is especially useful when you accidentally suspend a task and want it to keep running without occupying the terminal session</p><p>Usage Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*2-CIkhXx6eISlqQsgayniQ.png" /></figure><p>If you want to terminate any bg job — Use kill %1 (for job [1])</p><p><strong>6. The “dstat” command:</strong></p><p><strong>Description:<br></strong>The dstat command is a versatile Linux system performance monitoring tool that combines features of vmstat, iostat, netstat, and ifstat. It provides real-time statistics on various system metrics like CPU usage, disk I/O, network bandwidth, memory usage, and more.</p><p><strong>Usage Example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*bgNtJtn_q_l1RiVysy36ng.png" /><figcaption>Command: <strong>dstat — disk-util — load — mem — swap -c</strong></figcaption></figure><p><strong>7) The “lsof” command:</strong></p><p><strong>Description:</strong><br>The lsof (List Open Files) command in Linux provides a way to list all open files and the processes using them. It&#39;s useful for troubleshooting resource usage, file locks, and identifying which processes are accessing specific files. Common uses include finding files opened by a particular user or process, checking which processes are using a specific network port, and identifying deleted files still held open by processes. This can be invaluable for managing system resources or diagnosing issues like file locks and network connectivity.</p><p><strong>Example Usage:<br>Find the port that is being occupied by the PID 1366</strong></p><p><em>lsof -i -P -n | grep 1366</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*hzwrmLfzGY-qF_htTeEvKg.png" /><figcaption><strong>Port is 1900</strong></figcaption></figure><p><strong>8) The “CTRL + R” keyboard shortcut:</strong></p><p><strong>Description:<br></strong>The Ctrl + R shortcut in the Linux terminal is used to <strong>search through your command history</strong> interactively. It is a feature provided by the <strong>Readline library</strong>, which powers many command-line interfaces like bash and zsh.</p><p><strong>Example Usage:<br></strong>Press Ctrl + R to start the reverse incremental search. The terminal will display:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mYhKhLQt_tqE67ivTzgcug.png" /><figcaption>This indicates that you are now in search mode.</figcaption></figure><p>As you start typing the command, It looks for the command history and displays the full command.<br>Press Enter to execute the command.<br>Press Right/Left Arrow Key to edit the displayed command.</p><p>(It makes working with Linux super faster :P, Thank me later!)</p><p><strong>9) The “ESC + .” keyboard shortcut:</strong></p><p><strong>Description:<br></strong>The Esc + . shortcut in the Linux terminal is used to <strong>recall the last argument</strong> from the most recently executed command. This is a convenient feature for quickly reusing parts of previous commands without retyping.</p><p><strong>Example usage:<br></strong>a. Pressing Esc + . retrieves the final argument of the last command.<br>b. You can press Esc + . repeatedly to cycle through the last arguments of earlier commands in your history.</p><p>Assume that you can the command</p><pre>mv myfile.txt /tmp/yourfile.txt</pre><p>the last argument is <strong>/tmp/yourfile.txt<br></strong>You can use “ESC + .” to recall this last argument infront of any other command like below</p><pre>cat ESC + .<br>#Will automatically take<br>cat /tmp/yourfile.txt</pre><p><strong>10) The “CTRL + L” Keyboard shortcut:</strong></p><p><strong>Description:</strong><br>The Ctrl + L shortcut in the Linux terminal clears the screen, providing a clean workspace without deleting the scrollback buffer. It’s a faster alternative to the clear command and works in most shells like bash and zsh</p><p>Avoid typing “clear” command every time :P</p><p>Thank you all! Stay tuned for the next one!</p><p>For anyone starting their Linux journey, remember this: <em>Linux isn’t just an operating system; it’s a gateway to understanding the core principles of computing.</em> Start small, mastering essential commands like navigating the file system, managing processes, and manipulating files. These basics form the foundation for more advanced topics. <strong>Practice is key</strong> — break things (in a virtual environment), troubleshoot errors, and experiment without fear. The more hands-on you are, the faster you’ll grow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bd9a1945f4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>