<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cheat Sheets Archives - awsprep</title>
	<atom:link href="https://awsprep.co/category/cheat-sheets/feed/" rel="self" type="application/rss+xml" />
	<link>https://awsprep.co/category/cheat-sheets/</link>
	<description></description>
	<lastBuildDate>Tue, 11 Mar 2025 02:03:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://awsprep.co/wp-content/uploads/2024/04/cropped-aws.512x512-32x32.png</url>
	<title>Cheat Sheets Archives - awsprep</title>
	<link>https://awsprep.co/category/cheat-sheets/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ansible Cheat Sheet: Quick Reference Guide</title>
		<link>https://awsprep.co/ansible-cheat-sheet-quick-reference-guide/</link>
					<comments>https://awsprep.co/ansible-cheat-sheet-quick-reference-guide/#respond</comments>
		
		<dc:creator><![CDATA[Sreehas Dommata]]></dc:creator>
		<pubDate>Tue, 11 Mar 2025 02:02:43 +0000</pubDate>
				<category><![CDATA[Cheat Sheets]]></category>
		<guid isPermaLink="false">https://awsprep.co/?p=3303</guid>

					<description><![CDATA[<p>Ansible is a powerful automation tool used for configuration management, application deployment, and task automation. It simplifies complex&#8230;</p>
<p>The post <a href="https://awsprep.co/ansible-cheat-sheet-quick-reference-guide/">Ansible Cheat Sheet: Quick Reference Guide</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Ansible is a powerful automation tool used for configuration management, application deployment, and task automation. It simplifies complex tasks and ensures consistency across environments. </p>



<p>Whether you&#8217;re a beginner or an experienced user, this Ansible cheat sheet will help you streamline your automation workflows.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="essential-ansible-commands" class="wp-block-heading"><strong>Essential Ansible Commands</strong></h2>



<h3 id="1-inventory-management" class="wp-block-heading"><strong>1. Inventory Management</strong></h3>



<p>Ansible uses an inventory file to define the hosts and groups of hosts on which commands and playbooks will run.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command/File</th><th>Description</th></tr></thead><tbody><tr><td><code>/etc/ansible/hosts</code></td><td>Default location for the inventory file.</td></tr><tr><td><code>ansible-inventory --list</code></td><td>Lists all hosts and groups in the inventory.</td></tr><tr><td><code>ansible-inventory --graph</code></td><td>Displays a visual representation of the inventory.</td></tr><tr><td><code>[group-name]</code></td><td>Defines a group of hosts in the inventory file.</td></tr><tr><td><code>[group-name:vars]</code></td><td>Defines variables for a specific group.</td></tr></tbody></table></figure>



<h5 id="example-inventory-file" class="wp-block-heading">Example Inventory File:</h5>


<pre class="wp-block-code"><span><code class="hljs language-javascript">&#91;webservers]
web1.example.com
web2.example.com

&#91;dbservers]
db1.example.com
db2.example.com

&#91;webservers:vars]
ansible_user=admin
ansible_ssh_private_key_file=<span class="hljs-regexp">/path/</span>to/key.pem</code></span></pre>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="2-ad-hoc-commands" class="wp-block-heading"><strong>2. Ad-Hoc Commands</strong></h3>



<p>Ad-hoc commands are used to execute quick tasks on remote hosts without writing a playbook.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>ansible &lt;group&gt; -m &lt;module&gt; -a "&lt;arguments&gt;"</code></td><td>Runs a module on a group of hosts.</td></tr><tr><td><code>ansible all -m ping</code></td><td>Pings all hosts in the inventory.</td></tr><tr><td><code>ansible webservers -m shell -a "uptime"</code></td><td>Runs the <code>uptime</code> command on all webservers.</td></tr><tr><td><code>ansible dbservers -m yum -a "name=httpd state=present"</code></td><td>Installs the <code>httpd</code> package on all dbservers.</td></tr><tr><td><code>ansible all -m copy -a "src=/file.txt dest=/tmp/file.txt"</code></td><td>Copies a file to all hosts.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="3-playbook-execution" class="wp-block-heading"><strong>3. Playbook Execution</strong></h3>



<p>Playbooks are YAML files that define automation tasks.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>ansible-playbook &lt;playbook.yml&gt;</code></td><td>Runs a playbook.</td></tr><tr><td><code>ansible-playbook &lt;playbook.yml&gt; --limit &lt;group&gt;</code></td><td>Runs a playbook on a specific group of hosts.</td></tr><tr><td><code>ansible-playbook &lt;playbook.yml&gt; --start-at-task="task-name"</code></td><td>Starts a playbook at a specific task.</td></tr><tr><td><code>ansible-playbook &lt;playbook.yml&gt; --check</code></td><td>Performs a dry run without making changes.</td></tr><tr><td><code>ansible-playbook &lt;playbook.yml&gt; --tags &lt;tag-name&gt;</code></td><td>Runs only tasks with a specific tag.</td></tr></tbody></table></figure>



<h5 id="example-playbook" class="wp-block-heading">Example Playbook:</h5>


<pre class="wp-block-code"><span><code class="hljs">- name: Install and start Apache
  hosts: webservers
  become: yes
  tasks:
    - name: Install Apache
      yum:
        name: httpd
        state: present

    - name: Start Apache service
      service:
        name: httpd
        state: started</code></span></pre>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="4-modules" class="wp-block-heading"><strong>4. Modules</strong></h3>



<p>Modules are the building blocks of Ansible, used to perform specific tasks.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Module</th><th>Description</th></tr></thead><tbody><tr><td><code>yum</code></td><td>Manages packages on Red Hat-based systems.</td></tr><tr><td><code>apt</code></td><td>Manages packages on Debian-based systems.</td></tr><tr><td><code>service</code></td><td>Manages services.</td></tr><tr><td><code>copy</code></td><td>Copies files to remote hosts.</td></tr><tr><td><code>file</code></td><td>Manages files and directories.</td></tr><tr><td><code>shell</code></td><td>Executes shell commands.</td></tr><tr><td><code>template</code></td><td>Renders a template file and copies it to the remote host.</td></tr><tr><td><code>user</code></td><td>Manages user accounts.</td></tr><tr><td><code>debug</code></td><td>Prints debug messages during playbook execution.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="5-variables-and-facts" class="wp-block-heading"><strong>5. Variables and Facts</strong></h3>



<p>Variables allow you to customize playbooks, and facts provide information about remote hosts.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>ansible &lt;host&gt; -m setup</code></td><td>Displays all facts about a host.</td></tr><tr><td><code>{{ variable_name }}</code></td><td>Syntax to use variables in playbooks.</td></tr><tr><td><code>vars:</code></td><td>Defines variables in a playbook.</td></tr><tr><td><code>hostvars</code></td><td>Accesses variables from other hosts.</td></tr></tbody></table></figure>



<h5 id="example" class="wp-block-heading">Example:</h5>


<pre class="wp-block-code"><span><code class="hljs language-javascript">- name: Use variables
  <span class="hljs-attr">hosts</span>: all
  <span class="hljs-attr">vars</span>:
    app_port: <span class="hljs-number">8080</span>
  <span class="hljs-attr">tasks</span>:
    - name: Print variable value
      <span class="hljs-attr">debug</span>:
        msg: <span class="hljs-string">"The app port is {{ app_port }}"</span></code></span></pre>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="6-conditionals-and-loops" class="wp-block-heading"><strong>6. Conditionals and Loops</strong></h3>



<p>Conditionals and loops allow you to control task execution and repeat tasks.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Syntax</th><th>Description</th></tr></thead><tbody><tr><td><code>when: &lt;condition&gt;</code></td><td>Executes a task only if the condition is true.</td></tr><tr><td><code>with_items: &lt;list&gt;</code></td><td>Iterates over a list of items.</td></tr><tr><td><code>loop:</code></td><td>Modern alternative to <code>with_items</code>.</td></tr></tbody></table></figure>



<h5 id="example-2" class="wp-block-heading">Example:</h5>


<pre class="wp-block-code"><span><code class="hljs language-javascript">- name: Install multiple packages
  <span class="hljs-attr">hosts</span>: all
  <span class="hljs-attr">tasks</span>:
    - name: Install packages
      <span class="hljs-attr">yum</span>:
        name: <span class="hljs-string">"{{ item }}"</span>
        <span class="hljs-attr">state</span>: present
      <span class="hljs-attr">loop</span>:
        - httpd
        - mariadb
        - php</code></span></pre>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="7-roles" class="wp-block-heading"><strong>7. Roles</strong></h3>



<p>Roles are reusable units of automation that organize playbooks and tasks.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>ansible-galaxy init &lt;role-name&gt;</code></td><td>Creates a new role structure.</td></tr><tr><td><code>roles/</code></td><td>Directory where roles are stored.</td></tr><tr><td><code>ansible-galaxy install &lt;role-name&gt;</code></td><td>Installs a role from Ansible Galaxy.</td></tr></tbody></table></figure>



<h5 id="example-role-structure" class="wp-block-heading">Example Role Structure:</h5>


<pre class="wp-block-code"><span><code class="hljs">roles/
  common/
    tasks/
    handlers/
    templates/
    files/
    vars/
    defaults/
    meta/</code></span></pre>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="8-handlers" class="wp-block-heading"><strong>8. Handlers</strong></h3>



<p>Handlers are tasks that run only when notified by other tasks.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Syntax</th><th>Description</th></tr></thead><tbody><tr><td><code>notify: &lt;handler-name&gt;</code></td><td>Triggers a handler after a task.</td></tr><tr><td><code>handlers:</code></td><td>Defines handlers in a playbook.</td></tr></tbody></table></figure>



<h5 id="example-3" class="wp-block-heading">Example:</h5>


<pre class="wp-block-code"><span><code class="hljs">- name: Restart Apache
  hosts: webservers
  tasks:
    - name: Install Apache
      yum:
        name: httpd
        state: present
      notify: Restart Apache service

  handlers:
    - name: Restart Apache service
      service:
        name: httpd
        state: restarted</code></span></pre>


<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="common-ansible-challenges-and-solutions" class="wp-block-heading"><strong>Common Ansible Challenges and Solutions</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Challenge</th><th>Solution</th></tr></thead><tbody><tr><td><strong>Permission denied errors</strong></td><td>Use <code>become: yes</code> to escalate privileges.</td></tr><tr><td><strong>Slow playbook execution</strong></td><td>Use <code>strategy: free</code> in the playbook to speed up execution.</td></tr><tr><td><strong>Undefined variables</strong></td><td>Ensure variables are defined in the inventory, playbook, or role.</td></tr><tr><td><strong>Idempotency issues</strong></td><td>Use modules that ensure idempotency (e.g., <code>yum</code>, <code>apt</code>).</td></tr><tr><td><strong>Debugging playbooks</strong></td><td>Use the <code>debug</code> module to print variable values and task outputs.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="faqs-about-ansible" class="wp-block-heading"><strong>FAQs About Ansible</strong></h2>



<div class="schema-faq wp-block-yoast-faq-block"><div class="schema-faq-section" id="faq-question-1741658020096"><strong class="schema-faq-question"><strong>What is the difference between <code>ansible-playbook</code> and <code>ansible</code>?</strong></strong> <p class="schema-faq-answer"><code>ansible</code> is used for ad-hoc commands.<br/><code>ansible-playbook</code> is used to execute playbooks.</p> </div> <div class="schema-faq-section" id="faq-question-1741658117329"><strong class="schema-faq-question"><strong>How do I check the syntax of a playbook?</strong></strong> <p class="schema-faq-answer">Use the command:<br/><code>ansible-playbook &lt;playbook.yml> --syntax-check</code></p> </div> <div class="schema-faq-section" id="faq-question-1741658129836"><strong class="schema-faq-question"><strong>Can I use Ansible for Windows?</strong></strong> <p class="schema-faq-answer">Yes, Ansible supports Windows using the <code>win_*</code> modules (e.g., <code>win_package</code>, <code>win_service</code>).</p> </div> <div class="schema-faq-section" id="faq-question-1741658141160"><strong class="schema-faq-question"><strong>How do I manage secrets in Ansible?</strong></strong> <p class="schema-faq-answer">Use Ansible Vault to encrypt sensitive data:<br/><code>ansible-vault create &lt;file.yml><br/>ansible-vault edit &lt;file.yml><br/>ansible-playbook &lt;playbook.yml> --ask-vault-pass</code></p> </div> </div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<ul class="wp-block-list"></ul>



<h2 id="pro-tips-for-using-ansible" class="wp-block-heading"><strong>Pro Tips for Using Ansible</strong></h2>



<ol class="wp-block-list">
<li><strong>Use Roles for Reusability</strong>: Organize your playbooks into roles for better maintainability.</li>



<li><strong>Leverage Tags</strong>: Use tags to run specific tasks or groups of tasks.</li>



<li><strong>Test Playbooks</strong>: Use <code>--check</code> and <code>--diff</code> to test playbooks before execution.</li>



<li><strong>Use Ansible Galaxy</strong>: Explore and reuse roles from Ansible Galaxy to save time.</li>



<li><strong>Document Your Playbooks</strong>: Add comments and descriptions to make playbooks easier to understand.</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p></p>
<p>The post <a href="https://awsprep.co/ansible-cheat-sheet-quick-reference-guide/">Ansible Cheat Sheet: Quick Reference Guide</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awsprep.co/ansible-cheat-sheet-quick-reference-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Git Cheat Sheet: Essential Commands and Tips</title>
		<link>https://awsprep.co/git-cheat-sheet-essential-commands-and-tips/</link>
					<comments>https://awsprep.co/git-cheat-sheet-essential-commands-and-tips/#respond</comments>
		
		<dc:creator><![CDATA[Sreehas Dommata]]></dc:creator>
		<pubDate>Fri, 07 Mar 2025 02:23:51 +0000</pubDate>
				<category><![CDATA[Cheat Sheets]]></category>
		<guid isPermaLink="false">https://awsprep.co/?p=3296</guid>

					<description><![CDATA[<p>Git is a powerful version control system that helps developers manage code changes, collaborate with teams, and maintain&#8230;</p>
<p>The post <a href="https://awsprep.co/git-cheat-sheet-essential-commands-and-tips/">Git Cheat Sheet: Essential Commands and Tips</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Git is a powerful version control system that helps developers manage code changes, collaborate with teams, and maintain project history. Whether you&#8217;re a beginner or an experienced developer, this Git cheat sheet will save you time and effort.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="essential-git-commands" class="wp-block-heading"><strong>Essential Git Commands</strong></h2>



<h3 id="1-repository-setup" class="wp-block-heading"><strong>1. Repository Setup</strong></h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>git init</code></td><td>Initializes a new Git repository in the current directory.</td></tr><tr><td><code>git clone &lt;repository-url&gt;</code></td><td>Clones a remote repository to your local machine.</td></tr><tr><td><code>git remote add origin &lt;repository-url&gt;</code></td><td>Adds a remote repository URL (e.g., GitHub) to your local repo.</td></tr><tr><td><code>git remote -v</code></td><td>Lists all remote repositories linked to your local repo.</td></tr></tbody></table></figure>



<h3 id="2-basic-workflow" class="wp-block-heading"><strong>2. Basic Workflow</strong></h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>git status</code></td><td>Shows the status of your working directory (untracked, modified, or staged files).</td></tr><tr><td><code>git add &lt;file&gt;</code></td><td>Stages a specific file for commit.</td></tr><tr><td><code>git add .</code></td><td>Stages all changes in the working directory.</td></tr><tr><td><code>git commit -m "commit message"</code></td><td>Commits staged changes with a descriptive message.</td></tr><tr><td><code>git push origin &lt;branch&gt;</code></td><td>Pushes local commits to a remote repository.</td></tr><tr><td><code>git pull origin &lt;branch&gt;</code></td><td>Fetches and merges changes from a remote repository to your local branch.</td></tr></tbody></table></figure>



<h3 id="3-branching-and-merging" class="wp-block-heading"><strong>3. Branching and Merging</strong></h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>git branch</code></td><td>Lists all local branches.</td></tr><tr><td><code>git branch &lt;branch-name&gt;</code></td><td>Creates a new branch.</td></tr><tr><td><code>git checkout &lt;branch-name&gt;</code></td><td>Switches to the specified branch.</td></tr><tr><td><code>git checkout -b &lt;branch-name&gt;</code></td><td>Creates and switches to a new branch.</td></tr><tr><td><code>git merge &lt;branch-name&gt;</code></td><td>Merges the specified branch into the current branch.</td></tr><tr><td><code>git branch -d &lt;branch-name&gt;</code></td><td>Deletes a local branch.</td></tr><tr><td><code>git push origin --delete &lt;branch-name&gt;</code></td><td>Deletes a remote branch.</td></tr></tbody></table></figure>



<h3 id="4-viewing-history-and-changes" class="wp-block-heading"><strong>4. Viewing History and Changes</strong></h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>git log</code></td><td>Displays the commit history.</td></tr><tr><td><code>git log --oneline</code></td><td>Shows a simplified commit history (one line per commit).</td></tr><tr><td><code>git diff</code></td><td>Shows unstaged changes in the working directory.</td></tr><tr><td><code>git diff &lt;file&gt;</code></td><td>Shows changes in a specific file.</td></tr><tr><td><code>git diff &lt;commit1&gt; &lt;commit2&gt;</code></td><td>Compares changes between two commits.</td></tr><tr><td><code>git show &lt;commit&gt;</code></td><td>Displays details of a specific commit.</td></tr></tbody></table></figure>



<h3 id="5-undoing-changes" class="wp-block-heading"><strong>5. Undoing Changes</strong></h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>git restore &lt;file&gt;</code></td><td>Discards changes in the working directory for a specific file.</td></tr><tr><td><code>git restore --staged &lt;file&gt;</code></td><td>Unstages a file but keeps changes in the working directory.</td></tr><tr><td><code>git reset --hard</code></td><td>Discards all local changes and resets to the last commit.</td></tr><tr><td><code>git revert &lt;commit&gt;</code></td><td>Creates a new commit that undoes the changes of a specific commit.</td></tr><tr><td><code>git commit --amend</code></td><td>Modifies the most recent commit (e.g., to update the commit message).</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="advanced-git-commands" class="wp-block-heading"><strong>Advanced Git Commands</strong></h2>



<h3 id="1-stashing-changes" class="wp-block-heading"><strong>1. Stashing Changes</strong></h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>git stash</code></td><td>Temporarily saves changes in the working directory.</td></tr><tr><td><code>git stash list</code></td><td>Lists all stashed changes.</td></tr><tr><td><code>git stash apply</code></td><td>Applies the most recent stashed changes.</td></tr><tr><td><code>git stash pop</code></td><td>Applies and removes the most recent stashed changes.</td></tr><tr><td><code>git stash drop</code></td><td>Deletes the most recent stash.</td></tr></tbody></table></figure>



<h3 id="2-rebasing" class="wp-block-heading"><strong>2. Rebasing</strong></h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>git rebase &lt;branch&gt;</code></td><td>Reapplies commits from the current branch onto another branch.</td></tr><tr><td><code>git rebase --continue</code></td><td>Continues a rebase after resolving conflicts.</td></tr><tr><td><code>git rebase --abort</code></td><td>Aborts an ongoing rebase.</td></tr></tbody></table></figure>



<h3 id="3-tagging" class="wp-block-heading"><strong>3. Tagging</strong></h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>git tag &lt;tag-name&gt;</code></td><td>Creates a lightweight tag for the current commit.</td></tr><tr><td><code>git tag -a &lt;tag-name&gt; -m "message"</code></td><td>Creates an annotated tag with a message.</td></tr><tr><td><code>git push origin &lt;tag-name&gt;</code></td><td>Pushes a specific tag to the remote repository.</td></tr><tr><td><code>git push origin --tags</code></td><td>Pushes all tags to the remote repository.</td></tr></tbody></table></figure>



<h3 id="4-submodules" class="wp-block-heading"><strong>4. Submodules</strong></h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Command</th><th>Description</th></tr></thead><tbody><tr><td><code>git submodule add &lt;repository-url&gt;</code></td><td>Adds a submodule to your repository.</td></tr><tr><td><code>git submodule update --init --recursive</code></td><td>Initializes and updates submodules.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="common-git-challenges-and-solutions" class="wp-block-heading"><strong>Common Git Challenges and Solutions</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Challenge</th><th>Solution</th></tr></thead><tbody><tr><td><strong>Accidentally committed to the wrong branch</strong></td><td>Use <code>git stash</code> to save changes, switch to the correct branch, and apply the stash.</td></tr><tr><td><strong>Merge conflicts</strong></td><td>Resolve conflicts manually in the affected files, then use <code>git add</code> and <code>git commit</code> to complete the merge.</td></tr><tr><td><strong>Lost commit history</strong></td><td>Use <code>git reflog</code> to find the lost commit and reset to it.</td></tr><tr><td><strong>Large files in the repository</strong></td><td>Use <code>git filter-branch</code> or tools like <code>BFG Repo-Cleaner</code> to remove large files from history.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="faqs-about-git" class="wp-block-heading"><strong>FAQs About Git</strong></h2>



<div class="schema-faq wp-block-yoast-faq-block"><div class="schema-faq-section" id="faq-question-1741306738975"><strong class="schema-faq-question"><strong>What is the difference between <code>git pull</code> and <code>git fetch</code>?</strong></strong> <p class="schema-faq-answer"><code>git fetch</code> downloads changes from the remote repository but does not merge them.<br/><code>git pull</code> downloads changes and automatically merges them into your current branch.</p> </div> <div class="schema-faq-section" id="faq-question-1741306760015"><strong class="schema-faq-question"><strong>How do I squash multiple commits into one?</strong></strong> <p class="schema-faq-answer">Use <code>git rebase -i HEAD~&lt;number-of-commits></code> and mark commits as <code>squash</code> in the interactive editor.</p> </div> <div class="schema-faq-section" id="faq-question-1741306777344"><strong class="schema-faq-question"><strong>Can I recover a deleted branch?</strong></strong> <p class="schema-faq-answer">Yes, use <code>git reflog</code> to find the commit hash of the deleted branch and then run <code>git checkout -b &lt;branch-name> &lt;commit-hash></code>.</p> </div> <div class="schema-faq-section" id="faq-question-1741306793458"><strong class="schema-faq-question"><strong>How do I ignore files in Git?</strong></strong> <p class="schema-faq-answer">Create a <code>.gitignore</code> file in your repository and list the files or patterns you want to ignore.</p> </div> </div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="pro-tips-for-using-git" class="wp-block-heading"><strong>Pro Tips for Using Git</strong></h2>



<ol class="wp-block-list">
<li><strong>Write meaningful commit messages</strong>: Use clear and concise messages to describe changes.</li>



<li><strong>Use branches for new features</strong>: Always create a new branch for feature development to avoid disrupting the main branch.</li>



<li><strong>Regularly pull changes</strong>: Sync your local repository with the remote repository to avoid merge conflicts.</li>



<li><strong>Leverage Git hooks</strong>: Automate tasks like linting or testing using Git hooks.</li>
</ol>
<p>The post <a href="https://awsprep.co/git-cheat-sheet-essential-commands-and-tips/">Git Cheat Sheet: Essential Commands and Tips</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awsprep.co/git-cheat-sheet-essential-commands-and-tips/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Terraform Cheat Sheet: Quick Reference Guide</title>
		<link>https://awsprep.co/terraform-cheat-sheet-quick-reference-guide/</link>
					<comments>https://awsprep.co/terraform-cheat-sheet-quick-reference-guide/#respond</comments>
		
		<dc:creator><![CDATA[Sreehas Dommata]]></dc:creator>
		<pubDate>Wed, 26 Feb 2025 06:25:44 +0000</pubDate>
				<category><![CDATA[Cheat Sheets]]></category>
		<guid isPermaLink="false">https://awsprep.co/?p=3288</guid>

					<description><![CDATA[<p>Terraform is a powerful tool for managing infrastructure as code (IaC), enabling you to define, provision, and manage&#8230;</p>
<p>The post <a href="https://awsprep.co/terraform-cheat-sheet-quick-reference-guide/">Terraform Cheat Sheet: Quick Reference Guide</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Terraform is a powerful tool for managing infrastructure as code (IaC), enabling you to define, provision, and manage cloud resources efficiently. However, its extensive features and syntax can be overwhelming. Whether you&#8217;re provisioning a new environment, managing state, or troubleshooting issues, having a Terraform cheat sheet at your fingertips can save you time and effort.</p>



<p>This guide expands on the basics, providing detailed tables of commands, advanced tips, and FAQs to help you become a Terraform expert.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="essential-terraform-commands" class="wp-block-heading">Essential Terraform Commands</h2>



<h3 id="1-initialization-and-workspace-commands" class="wp-block-heading">1. Initialization and Workspace Commands</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform init</code></td><td>Initializes a Terraform working directory, downloading providers and modules.</td></tr><tr><td><code>terraform workspace new &lt;name&gt;</code></td><td>Creates a new workspace for managing multiple environments.</td></tr><tr><td><code>terraform workspace select &lt;name&gt;</code></td><td>Switches to a different workspace.</td></tr><tr><td><code>terraform workspace list</code></td><td>Lists all available workspaces.</td></tr><tr><td><code>terraform workspace delete &lt;name&gt;</code></td><td>Deletes a specific workspace.</td></tr><tr><td><code>terraform init -upgrade</code></td><td>Upgrades modules and providers to the latest versions.</td></tr><tr><td><code>terraform init -backend-config=&lt;file&gt;</code></td><td>Configures the backend during initialization.</td></tr><tr><td><code>terraform init -reconfigure</code></td><td>Reconfigures the backend without migrating state.</td></tr><tr><td><code>terraform init -migrate-state</code></td><td>Migrates the state to a new backend.</td></tr></tbody></table></figure>



<h3 id="2-planning-and-applying-changes" class="wp-block-heading">2. Planning and Applying Changes</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform plan</code></td><td>Generates an execution plan, showing what changes will be made.</td></tr><tr><td><code>terraform apply</code></td><td>Applies the changes required to reach the desired state.</td></tr><tr><td><code>terraform apply -auto-approve</code></td><td>Applies changes without requiring manual approval.</td></tr><tr><td><code>terraform plan -out=&lt;file&gt;.tfplan</code></td><td>Saves the execution plan to a file for later use.</td></tr><tr><td><code>terraform apply &lt;file&gt;.tfplan</code></td><td>Applies changes using a saved execution plan.</td></tr><tr><td><code>terraform validate</code></td><td>Validates the configuration files for syntax errors.</td></tr><tr><td><code>terraform fmt</code></td><td>Rewrites configuration files to a canonical format.</td></tr><tr><td><code>terraform plan -destroy</code></td><td>Generates a plan to destroy all resources.</td></tr><tr><td><code>terraform apply -refresh-only</code></td><td>Updates the state file without making changes to resources.</td></tr><tr><td><code>terraform plan -detailed-exitcode</code></td><td>Returns a detailed exit code when changes are detected.</td></tr><tr><td><code>terraform apply -parallelism=&lt;n&gt;</code></td><td>Limits the number of concurrent operations during apply.</td></tr></tbody></table></figure>



<h3 id="3-state-management-commands" class="wp-block-heading">3. State Management Commands</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform state list</code></td><td>Lists all resources in the Terraform state.</td></tr><tr><td><code>terraform state show &lt;resource&gt;</code></td><td>Displays detailed information about a specific resource.</td></tr><tr><td><code>terraform state mv &lt;src&gt; &lt;dest&gt;</code></td><td>Moves a resource within the state file.</td></tr><tr><td><code>terraform state rm &lt;resource&gt;</code></td><td>Removes a resource from the state file.</td></tr><tr><td><code>terraform refresh</code></td><td>Updates the state file with real-world infrastructure.</td></tr><tr><td><code>terraform state pull</code></td><td>Pulls the current state from the remote backend.</td></tr><tr><td><code>terraform state push &lt;file&gt;</code></td><td>Pushes a local state file to the remote backend.</td></tr><tr><td><code>terraform state replace-provider</code></td><td>Replaces the provider in the state file.</td></tr><tr><td><code>terraform state list &lt;address&gt;</code></td><td>Lists resources matching a specific address.</td></tr><tr><td><code>terraform state show &lt;address&gt;</code></td><td>Shows details of a resource at a specific address.</td></tr></tbody></table></figure>



<h3 id="4-destroying-resources" class="wp-block-heading">4. Destroying Resources</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform destroy</code></td><td>Destroys all resources managed by the current configuration.</td></tr><tr><td><code>terraform destroy -target=&lt;resource&gt;</code></td><td>Destroys a specific resource.</td></tr><tr><td><code>terraform destroy -auto-approve</code></td><td>Destroys resources without requiring manual approval.</td></tr><tr><td><code>terraform destroy -refresh=false</code></td><td>Skips refreshing the state before destroying resources.</td></tr></tbody></table></figure>



<h3 id="5-output-and-input-variables" class="wp-block-heading">5. Output and Input Variables</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform output</code></td><td>Displays the values of output variables.</td></tr><tr><td><code>terraform output &lt;variable&gt;</code></td><td>Displays the value of a specific output variable.</td></tr><tr><td><code>terraform apply -var="key=value"</code></td><td>Sets an input variable during <code>apply</code>.</td></tr><tr><td><code>terraform apply -var-file=&lt;file&gt;</code></td><td>Applies variables from a specific file.</td></tr><tr><td><code>terraform output -json</code></td><td>Outputs the variables in JSON format.</td></tr><tr><td><code>terraform output -raw &lt;variable&gt;</code></td><td>Outputs the value of a variable without additional formatting.</td></tr><tr><td><code>terraform output -no-color</code></td><td>Disables colorized output.</td></tr></tbody></table></figure>



<h3 id="6-module-management" class="wp-block-heading">6. Module Management</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform get</code></td><td>Downloads and updates modules in the working directory.</td></tr><tr><td><code>terraform init -upgrade</code></td><td>Upgrades modules and providers to the latest versions.</td></tr><tr><td><code>terraform init -backend-config=&lt;file&gt;</code></td><td>Configures the backend during initialization.</td></tr><tr><td><code>terraform get -update</code></td><td>Updates all modules to the latest versions.</td></tr></tbody></table></figure>



<h3 id="7-importing-existing-resources" class="wp-block-heading">7. Importing Existing Resources</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform import &lt;resource&gt; &lt;id&gt;</code></td><td>Imports an existing resource into the Terraform state.</td></tr><tr><td><code>terraform import module.&lt;name&gt;.&lt;resource&gt; &lt;id&gt;</code></td><td>Imports a resource into a module.</td></tr></tbody></table></figure>



<h3 id="8-debugging-and-logging" class="wp-block-heading">8. Debugging and Logging</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>TF_LOG=DEBUG terraform apply</code></td><td>Enables debug logging for detailed troubleshooting.</td></tr><tr><td><code>TF_LOG_PATH=&lt;file&gt;</code></td><td>Saves logs to a specific file.</td></tr><tr><td><code>TF_LOG=TRACE terraform plan</code></td><td>Enables trace logging for even more detailed output.</td></tr><tr><td><code>TF_LOG_CORE=DEBUG terraform apply</code></td><td>Enables debug logging for Terraform core.</td></tr></tbody></table></figure>



<h3 id="9-remote-state-management" class="wp-block-heading">9. Remote State Management</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform state pull</code></td><td>Pulls the current state from the remote backend.</td></tr><tr><td><code>terraform state push &lt;file&gt;</code></td><td>Pushes a local state file to the remote backend.</td></tr><tr><td><code>terraform force-unlock &lt;lock-id&gt;</code></td><td>Manually unlocks the state file if locking fails.</td></tr></tbody></table></figure>



<h3 id="10-provider-management" class="wp-block-heading">10. Provider Management</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform providers</code></td><td>Displays information about the providers used in the configuration.</td></tr><tr><td><code>terraform providers lock</code></td><td>Locks the provider versions to ensure consistency.</td></tr><tr><td><code>terraform providers mirror &lt;path&gt;</code></td><td>Mirrors providers to a local directory for offline use.</td></tr></tbody></table></figure>



<h3 id="11-tainting-and-untainting-resources" class="wp-block-heading">11. Tainting and Untainting Resources</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform taint &lt;resource&gt;</code></td><td>Marks a resource as tainted, forcing it to be recreated on the next apply.</td></tr><tr><td><code>terraform untaint &lt;resource&gt;</code></td><td>Removes the taint from a resource.</td></tr></tbody></table></figure>



<h3 id="12-graph-visualization" class="wp-block-heading">12. Graph Visualization</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform graph</code></td><td>Generates a visual representation of the configuration or execution plan.</td></tr><tr><td><code>terraform graph | dot -Tpng &gt; graph.png</code></td><td>Creates a PNG image of the dependency graph.</td></tr><tr><td><code>terraform graph -type=plan</code></td><td>Generates a graph for the execution plan.</td></tr></tbody></table></figure>



<h3 id="13-output-filtering" class="wp-block-heading">13. Output Filtering</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform output -json</code></td><td>Outputs the variables in JSON format.</td></tr><tr><td><code>terraform output -raw &lt;variable&gt;</code></td><td>Outputs the value of a variable without additional formatting.</td></tr></tbody></table></figure>



<h3 id="14-resource-targeting" class="wp-block-heading">14. Resource Targeting</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform plan -target=&lt;resource&gt;</code></td><td>Limits the plan to a specific resource.</td></tr><tr><td><code>terraform apply -target=&lt;resource&gt;</code></td><td>Limits the apply to a specific resource.</td></tr></tbody></table></figure>



<h3 id="15-state-locking" class="wp-block-heading">15. State Locking</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform force-unlock &lt;lock-id&gt;</code></td><td>Manually unlocks the state file if locking fails.</td></tr></tbody></table></figure>



<h3 id="16-importing-modules" class="wp-block-heading">16. Importing Modules</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform import module.&lt;name&gt;.&lt;resource&gt; &lt;id&gt;</code></td><td>Imports a resource into a module.</td></tr></tbody></table></figure>



<h3 id="17-managing-backends" class="wp-block-heading">17. Managing Backends</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform init -reconfigure</code></td><td>Reconfigures the backend without migrating state.</td></tr><tr><td><code>terraform init -migrate-state</code></td><td>Migrates the state to a new backend.</td></tr></tbody></table></figure>



<h3 id="18-resource-targeting" class="wp-block-heading">18. Resource Targeting</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform plan -target=&lt;resource&gt;</code></td><td>Limits the plan to a specific resource.</td></tr><tr><td><code>terraform apply -target=&lt;resource&gt;</code></td><td>Limits the apply to a specific resource.</td></tr></tbody></table></figure>



<h3 id="19-state-locking" class="wp-block-heading">19. State Locking</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform force-unlock &lt;lock-id&gt;</code></td><td>Manually unlocks the state file if locking fails.</td></tr></tbody></table></figure>



<h3 id="20-importing-modules" class="wp-block-heading">20. Importing Modules</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform import module.&lt;name&gt;.&lt;resource&gt; &lt;id&gt;</code></td><td>Imports a resource into a module.</td></tr></tbody></table></figure>



<h3 id="21-managing-backends" class="wp-block-heading">21. Managing Backends</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>terraform init -reconfigure</code></td><td>Reconfigures the backend without migrating state.</td></tr><tr><td><code>terraform init -migrate-state</code></td><td>Migrates the state to a new backend.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="common-terraform-challenges-and-solutions" class="wp-block-heading">Common Terraform Challenges and Solutions</h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Challenge</strong></th><th><strong>Solution</strong></th></tr></thead><tbody><tr><td>State file conflicts</td><td>Use <code>terraform state</code> commands to manually resolve conflicts.</td></tr><tr><td>Provider version issues</td><td>Pin provider versions in <code>required_providers</code> block.</td></tr><tr><td>Resource dependency errors</td><td>Use <code>depends_on</code> to explicitly define dependencies.</td></tr><tr><td>Debugging plan errors</td><td>Enable debug logging with <code>TF_LOG=DEBUG</code>.</td></tr><tr><td>Managing large configurations</td><td>Break configurations into reusable modules.</td></tr><tr><td>Handling secrets securely</td><td>Use tools like HashiCorp Vault or environment variables.</td></tr><tr><td>Managing multiple environments</td><td>Use Terraform workspaces or separate directories for each environment.</td></tr><tr><td>State locking issues</td><td>Use <code>terraform force-unlock</code> to resolve state lock conflicts.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="faqs-about-terraform" class="wp-block-heading">FAQs About Terraform</h2>



<div class="schema-faq wp-block-yoast-faq-block"><div class="schema-faq-section" id="faq-question-1740550684223"><strong class="schema-faq-question"><strong>What is the Difference Between <code>terraform plan</code> and <code>terraform apply</code>?</strong></strong> <p class="schema-faq-answer"><code>terraform plan</code> generates an execution plan to show what changes will be made. <code>terraform apply</code> executes the plan and applies the changes to the infrastructure.</p> </div> <div class="schema-faq-section" id="faq-question-1740550710585"><strong class="schema-faq-question"><strong>How Do I Manage Secrets in Terraform?</strong></strong> <p class="schema-faq-answer">Use tools like HashiCorp Vault or environment variables to manage secrets securely. Avoid hardcoding secrets in Terraform files.</p> </div> <div class="schema-faq-section" id="faq-question-1740550718463"><strong class="schema-faq-question"><strong>Can I Use Terraform for Multi-Cloud Deployments?</strong></strong> <p class="schema-faq-answer">Yes, Terraform supports multi-cloud deployments by allowing you to define resources for different cloud providers in the same configuration.</p> </div> <div class="schema-faq-section" id="faq-question-1740550724819"><strong class="schema-faq-question"><strong>What is a Terraform Workspace?</strong></strong> <p class="schema-faq-answer">A workspace is an isolated environment for managing different states of the same configuration, useful for managing multiple environments (e.g., dev, staging, prod).</p> </div> <div class="schema-faq-section" id="faq-question-1740550732743"><strong class="schema-faq-question"><strong>How Do I Roll Back Changes in Terraform?</strong></strong> <p class="schema-faq-answer">Use <code>terraform state</code> commands to manually adjust the state or revert to a previous state file stored in version control.</p> </div> <div class="schema-faq-section" id="faq-question-1740550742487"><strong class="schema-faq-question"><strong>What is the Purpose of <code>terraform refresh</code>?</strong></strong> <p class="schema-faq-answer"><code>terraform refresh</code> updates the state file to match the real-world infrastructure, ensuring the state is accurate.</p> </div> <div class="schema-faq-section" id="faq-question-1740550787010"><strong class="schema-faq-question"><strong>How Do I Handle State Locking Issues?</strong></strong> <p class="schema-faq-answer">Use <code>terraform force-unlock &lt;lock-id></code> to manually unlock the state file if locking fails.</p> </div> </div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 id="must-know-terraform-tips" class="wp-block-heading">Must-Know Terraform Tips</h2>



<ol class="wp-block-list">
<li><strong>Use Version Control</strong>: Store your Terraform configurations in version control systems like Git to track changes and collaborate effectively.</li>



<li><strong>Leverage Modules</strong>: Create reusable modules to simplify complex configurations and promote consistency.</li>



<li><strong>Enable Remote State</strong>: Use remote backends like S3 or Terraform Cloud to store state files securely and enable team collaboration.</li>



<li><strong>Validate Configurations</strong>: Use <code>terraform validate</code> to check for syntax errors before applying changes.</li>



<li><strong>Automate with CI/CD</strong>: Integrate Terraform into CI/CD pipelines to automate infrastructure provisioning and updates.</li>



<li><strong>Use Sentinel Policies</strong>: Implement policy-as-code with Sentinel to enforce governance and compliance.</li>



<li><strong>Monitor Drift</strong>: Regularly run <code>terraform plan</code> to detect and address configuration drift.</li>



<li><strong>Use Resource Targeting</strong>: Use <code>-target</code> to apply changes to specific resources during development and testing.</li>



<li><strong>Backup State Files</strong>: Regularly back up your state files to prevent data loss.</li>



<li><strong>Use Workspaces</strong>: Use workspaces to manage multiple environments (e.g., dev, staging, prod) within the same configuration.</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>This Terraform cheat sheet is your ultimate guide to mastering infrastructure as code. With detailed tables, advanced tips, and FAQs, you’ll be able to tackle any challenge with confidence. Bookmark this page for quick reference, and happy provisioning! 🚀</p>
<p>The post <a href="https://awsprep.co/terraform-cheat-sheet-quick-reference-guide/">Terraform Cheat Sheet: Quick Reference Guide</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awsprep.co/terraform-cheat-sheet-quick-reference-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Kubernetes Cheat Sheet: Essential Commands</title>
		<link>https://awsprep.co/kubernetes-cheat-sheet-essential-commands/</link>
					<comments>https://awsprep.co/kubernetes-cheat-sheet-essential-commands/#respond</comments>
		
		<dc:creator><![CDATA[Sreehas Dommata]]></dc:creator>
		<pubDate>Mon, 17 Feb 2025 03:51:41 +0000</pubDate>
				<category><![CDATA[Cheat Sheets]]></category>
		<guid isPermaLink="false">https://awsprep.co/?p=3276</guid>

					<description><![CDATA[<p>Kubernetes is a powerful tool for managing containerized applications, but its complexity can be daunting. Whether you&#8217;re deploying&#8230;</p>
<p>The post <a href="https://awsprep.co/kubernetes-cheat-sheet-essential-commands/">Kubernetes Cheat Sheet: Essential Commands</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p></p>



<p>Kubernetes is a powerful tool for managing containerized applications, but its complexity can be daunting. Whether you&#8217;re deploying a new application, scaling services, or troubleshooting issues, having a <strong>Kubernetes cheat sheet</strong> at your fingertips can save you time and effort. </p>



<p>This guide expands on the basics, providing detailed tables of commands, advanced tips, and FAQs to help you become a Kubernetes expert.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="essential-kubernetes-commands" class="wp-block-heading">Essential Kubernetes Commands</h3>



<h4 id="1-cluster-management-commands" class="wp-block-heading">1. <strong>Cluster Management Commands</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>kubectl cluster-info</code></td><td>Displays information about the Kubernetes cluster.</td></tr><tr><td><code>kubectl get nodes</code></td><td>Lists all nodes in the cluster.</td></tr><tr><td><code>kubectl describe node &lt;node-name&gt;</code></td><td>Provides detailed information about a specific node.</td></tr><tr><td><code>kubectl config view</code></td><td>Displays the current Kubernetes configuration.</td></tr><tr><td><code>kubectl config use-context &lt;context&gt;</code></td><td>Switches to a different Kubernetes context.</td></tr></tbody></table></figure>



<h4 id="2-pod-management-commands" class="wp-block-heading">2. <strong>Pod Management Commands</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>kubectl get pods</code></td><td>Lists all pods in the current namespace.</td></tr><tr><td><code>kubectl describe pod &lt;pod-name&gt;</code></td><td>Provides detailed information about a specific pod.</td></tr><tr><td><code>kubectl logs &lt;pod-name&gt;</code></td><td>Displays logs for a specific pod.</td></tr><tr><td><code>kubectl exec -it &lt;pod-name&gt; -- /bin/sh</code></td><td>Opens an interactive shell inside a running pod.</td></tr><tr><td><code>kubectl delete pod &lt;pod-name&gt;</code></td><td>Deletes a specific pod.</td></tr></tbody></table></figure>



<h4 id="3-deployment-commands" class="wp-block-heading">3. <strong>Deployment Commands</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>kubectl create deployment &lt;name&gt; --image=&lt;image&gt;</code></td><td>Creates a new deployment using a specified container image.</td></tr><tr><td><code>kubectl get deployments</code></td><td>Lists all deployments in the current namespace.</td></tr><tr><td><code>kubectl describe deployment &lt;name&gt;</code></td><td>Provides detailed information about a specific deployment.</td></tr><tr><td><code>kubectl scale deployment &lt;name&gt; --replicas=&lt;number&gt;</code></td><td>Scales a deployment to the desired number of replicas.</td></tr><tr><td><code>kubectl rollout status deployment/&lt;name&gt;</code></td><td>Displays the rollout status of a deployment.</td></tr></tbody></table></figure>



<h4 id="4-service-management-commands" class="wp-block-heading">4. <strong>Service Management Commands</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>kubectl get services</code></td><td>Lists all services running in the cluster.</td></tr><tr><td><code>kubectl describe service &lt;service-name&gt;</code></td><td>Provides detailed information about a specific service.</td></tr><tr><td><code>kubectl expose deployment &lt;name&gt; --type=LoadBalancer --port=&lt;port&gt;</code></td><td>Exposes a deployment as a service.</td></tr><tr><td><code>kubectl delete service &lt;service-name&gt;</code></td><td>Deletes a specific service.</td></tr></tbody></table></figure>



<h4 id="5-namespace-commands" class="wp-block-heading">5. <strong>Namespace Commands</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>kubectl get namespaces</code></td><td>Lists all namespaces in the cluster.</td></tr><tr><td><code>kubectl create namespace &lt;name&gt;</code></td><td>Creates a new namespace.</td></tr><tr><td><code>kubectl delete namespace &lt;name&gt;</code></td><td>Deletes a specific namespace.</td></tr><tr><td><code>kubectl config set-context --current --namespace=&lt;name&gt;</code></td><td>Switches to a different namespace.</td></tr></tbody></table></figure>



<h4 id="6-configmap-and-secret-commands" class="wp-block-heading">6. <strong>ConfigMap and Secret Commands</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>kubectl create configmap &lt;name&gt; --from-literal=&lt;key&gt;=&lt;value&gt;</code></td><td>Creates a ConfigMap from a literal value.</td></tr><tr><td><code>kubectl get configmaps</code></td><td>Lists all ConfigMaps in the current namespace.</td></tr><tr><td><code>kubectl describe configmap &lt;name&gt;</code></td><td>Provides detailed information about a specific ConfigMap.</td></tr><tr><td><code>kubectl create secret generic &lt;name&gt; --from-literal=&lt;key&gt;=&lt;value&gt;</code></td><td>Creates a Secret from a literal value.</td></tr><tr><td><code>kubectl get secrets</code></td><td>Lists all Secrets in the current namespace.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="advanced-kubernetes-commands" class="wp-block-heading">Advanced Kubernetes Commands</h3>



<h4 id="1-resource-monitoring" class="wp-block-heading">1. <strong>Resource Monitoring</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>kubectl top nodes</code></td><td>Displays resource usage (CPU, memory) for nodes.</td></tr><tr><td><code>kubectl top pods</code></td><td>Displays resource usage (CPU, memory) for pods.</td></tr></tbody></table></figure>



<h4 id="2-rolling-updates-and-rollbacks" class="wp-block-heading">2. <strong>Rolling Updates and Rollbacks</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>kubectl set image deployment/&lt;name&gt; &lt;container&gt;=&lt;new-image&gt;</code></td><td>Updates the image of a deployment.</td></tr><tr><td><code>kubectl rollout history deployment/&lt;name&gt;</code></td><td>Displays the rollout history of a deployment.</td></tr><tr><td><code>kubectl rollout undo deployment/&lt;name&gt;</code></td><td>Rolls back a deployment to the previous version.</td></tr></tbody></table></figure>



<h4 id="3-job-and-cronjob-commands" class="wp-block-heading">3. <strong>Job and CronJob Commands</strong></h4>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Command</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>kubectl create job &lt;name&gt; --image=&lt;image&gt;</code></td><td>Creates a new job.</td></tr><tr><td><code>kubectl get jobs</code></td><td>Lists all jobs in the current namespace.</td></tr><tr><td><code>kubectl delete job &lt;name&gt;</code></td><td>Deletes a specific job.</td></tr><tr><td><code>kubectl create cronjob &lt;name&gt; --image=&lt;image&gt; --schedule="&lt;schedule&gt;"</code></td><td>Creates a new CronJob.</td></tr><tr><td><code>kubectl get cronjobs</code></td><td>Lists all CronJobs in the current namespace.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="common-kubernetes-challenges-and-solutions" class="wp-block-heading">Common Kubernetes Challenges and Solutions</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Challenge</strong></th><th><strong>Solution</strong></th></tr></thead><tbody><tr><td>Pods stuck in &#8220;Pending&#8221; state</td><td>Check node resources and taints with <code>kubectl describe node &lt;node-name&gt;</code>.</td></tr><tr><td>Services not accessible</td><td>Verify service type and endpoints with <code>kubectl describe service &lt;name&gt;</code>.</td></tr><tr><td>Configuration errors</td><td>Validate YAML files with <code>kubectl apply -f &lt;file&gt;.yaml --dry-run=client</code>.</td></tr><tr><td>Resource limits exceeded</td><td>Monitor usage with <code>kubectl top</code> and adjust resource requests/limits.</td></tr></tbody></table></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 id="faqs-about-kubernetes" class="wp-block-heading">FAQs About Kubernetes</h3>



<div class="schema-faq wp-block-yoast-faq-block"><div class="schema-faq-section" id="faq-question-1739764103076"><strong class="schema-faq-question"><strong>What is the Difference Between a Pod and a Deployment?</strong></strong> <p class="schema-faq-answer">A pod is the smallest deployable unit in Kubernetes, while a deployment manages the lifecycle of pods, ensuring the desired number of replicas are running.</p> </div> <div class="schema-faq-section" id="faq-question-1739764117616"><strong class="schema-faq-question"><strong>How Do I Access Kubernetes Dashboard?</strong></strong> <p class="schema-faq-answer">To access the Kubernetes dashboard, run: bash kubectl proxy. Then, open your browser and navigate to the provided URL.</p> </div> <div class="schema-faq-section" id="faq-question-1739764137140"><strong class="schema-faq-question"><strong>Can I Use Kubernetes for Small Projects?</strong></strong> <p class="schema-faq-answer">Yes, Kubernetes can be used for small projects, but it may be overkill for very simple applications. Consider using simpler tools like Docker Compose for smaller setups.</p> </div> </div>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>This <strong>Kubernetes cheat sheet</strong> is your ultimate guide to mastering Kubernetes commands and workflows. With detailed tables, advanced tips, and FAQs, you’ll be able to tackle any challenge with confidence. Bookmark this page for quick reference, and happy orchestrating!</p>
<p>The post <a href="https://awsprep.co/kubernetes-cheat-sheet-essential-commands/">Kubernetes Cheat Sheet: Essential Commands</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awsprep.co/kubernetes-cheat-sheet-essential-commands/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux Cheat Sheet</title>
		<link>https://awsprep.co/linux-cheat-sheet/</link>
					<comments>https://awsprep.co/linux-cheat-sheet/#respond</comments>
		
		<dc:creator><![CDATA[Sreehas Dommata]]></dc:creator>
		<pubDate>Mon, 28 Oct 2024 04:53:46 +0000</pubDate>
				<category><![CDATA[Cheat Sheets]]></category>
		<guid isPermaLink="false">https://awsprep.co/?p=2521</guid>

					<description><![CDATA[<p>Mastering Linux commands is essential for efficiently managing and automating tasks in a Linux environment. This cheat sheet&#8230;</p>
<p>The post <a href="https://awsprep.co/linux-cheat-sheet/">Linux Cheat Sheet</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Mastering Linux commands is essential for efficiently managing and automating tasks in a Linux environment. This cheat sheet provides a quick reference to commonly used commands, from basic file manipulations,networking, system monitoring and user management. </p>



<p>Whether you&#8217;re a beginner or an experienced user, these commands will help you work more effectively in the Linux shell.</p>



<h2 id="file-management" class="wp-block-heading"><strong>File Management</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>cat &gt; file.txt</td><td>Create or overwrite contents of a file.</td></tr><tr><td>cat file.txt</td><td>View file content.</td></tr><tr><td>cat &gt;&gt; file.txt</td><td>Append content to a file.</td></tr><tr><td>touch file.txt</td><td>Create an empty file.</td></tr><tr><td>touch .hiddenfile</td><td>Create a hidden file.</td></tr><tr><td>touch file1.txt file2.txt</td><td>Create multiple files.</td></tr><tr><td>cp &lt;source&gt; &lt;destination&gt;</td><td>Copy files and directories.</td></tr><tr><td>mv &lt;source&gt; &lt;destination&gt;</td><td>Move or rename files and directories.</td></tr><tr><td>rm &lt;file.txt&gt;</td><td>Remove a file.</td></tr><tr><td>rm -rf &lt;directory&gt;</td><td>Remove a directory and its contents recursively.</td></tr><tr><td>ln -s &lt;source&gt; &lt;target&gt;</td><td>Create a symbolic link (soft link).</td></tr><tr><td>ln &lt;source&gt; &lt;target&gt;</td><td>Create a hard link.</td></tr><tr><td>sort &lt;options&gt; &lt;file&gt;</td><td>Sort file content.</td></tr><tr><td>cut -d: -f3 &lt;file&gt;</td><td>Retrieve a specific column from a file using a delimiter.</td></tr></tbody></table></figure>



<h2 id="directory-management" class="wp-block-heading"><strong>Directory Management</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>mkdir &lt;directory&gt;</td><td>Create a new directory.</td></tr><tr><td>mkdir -p &lt;path&gt;</td><td>Create a directory and any parent directories as needed.</td></tr><tr><td>ls &lt;directory&gt;</td><td>List directory contents.</td></tr><tr><td>ls -al</td><td>List all files, including hidden ones, in a long format.</td></tr><tr><td>pwd</td><td>Display the current directory path.</td></tr><tr><td>cd &lt;directory&gt;</td><td>Change the current directory.</td></tr><tr><td>cd ../</td><td>Move one level up in the directory hierarchy.</td></tr><tr><td>rmdir &lt;directory&gt;</td><td>Remove an empty directory.</td></tr></tbody></table></figure>



<h2 id="viewing-and-editing-files" class="wp-block-heading"><strong>Viewing and Editing Files</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>less &lt;file.txt&gt;</td><td>View file content page by page.</td></tr><tr><td>head -n10 &lt;file.txt&gt;</td><td>View the first 10 lines of a file.</td></tr><tr><td>tail -n5 &lt;file.txt&gt;</td><td>View the last 5 lines of a file.</td></tr><tr><td>vim &lt;file&gt;</td><td>Edit a file using the Vim editor.</td></tr><tr><td>sed &#8216;s/old/new/g&#8217; &lt;file&gt;</td><td>Search and replace text in a file.</td></tr><tr><td>grep &lt;pattern&gt; &lt;file&gt;</td><td>Search for a pattern in a file.</td></tr><tr><td>awk &#8216;/pattern/ {print $1}&#8217; &lt;file&gt;</td><td>Pattern scanning and processing in files.</td></tr><tr><td>cat &lt;file&gt;</td><td>Concatenate and display file content.</td></tr><tr><td>tee &lt;file&gt;</td><td>Write output to a file and display it on the terminal.</td></tr><tr><td>uniq &lt;file&gt;</td><td>Remove duplicate lines from a file.</td></tr></tbody></table></figure>



<h2 id="file-compression" class="wp-block-heading"><strong>File Compression</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>gzip &lt;file&gt;</td><td>Compress a file.</td></tr><tr><td>gunzip &lt;file&gt;</td><td>Decompress a file.</td></tr><tr><td>tar -cvf &lt;archive.tar&gt; &lt;files&gt;</td><td>Create a tar archive.</td></tr><tr><td>tar -xvf &lt;archive.tar&gt;</td><td>Extract a tar archive.</td></tr></tbody></table></figure>



<h2 id="process-management" class="wp-block-heading"><strong>Process Management</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>ps aux</td><td>Display detailed information about running processes.</td></tr><tr><td>top</td><td>Display real-time system stats, including process info.</td></tr><tr><td>kill &lt;process_id&gt;</td><td>Terminate a process by its ID.</td></tr><tr><td>history</td><td>Show command history.</td></tr><tr><td>chmod 755 &lt;file&gt;</td><td>Change file permissions.</td></tr><tr><td>chown user:group &lt;file&gt;</td><td>Change file ownership.</td></tr></tbody></table></figure>



<h2 id="disk-and-file-system" class="wp-block-heading"><strong>Disk and File System</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>df -h</td><td>Display disk space usage in human-readable format.</td></tr><tr><td>du -sh &lt;directory&gt;</td><td>Display the size of a directory.</td></tr><tr><td>mount</td><td>Mount a filesystem.</td></tr><tr><td>umount &lt;device&gt;</td><td>Unmount a filesystem.</td></tr><tr><td>lsblk</td><td>List information about block devices.</td></tr></tbody></table></figure>



<h2 id="user-and-group-management" class="wp-block-heading"><strong>User and Group Management</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>useradd &lt;username&gt;</td><td>Create a new user.</td></tr><tr><td>usermod -l &lt;newname&gt; &lt;oldname&gt;</td><td>Change a username.</td></tr><tr><td>passwd &lt;username&gt;</td><td>Set or update a user’s password.</td></tr><tr><td>groupadd &lt;groupname&gt;</td><td>Create a new group.</td></tr><tr><td>gpasswd -M &lt;users&gt; &lt;group&gt;</td><td>Add multiple users to a group.</td></tr><tr><td>usermod -L &lt;username&gt;</td><td>Lock a user account.</td></tr><tr><td>usermod -U &lt;username&gt;</td><td>Unlock a user account.</td></tr></tbody></table></figure>



<h2 id="networking-and-system-monitoring" class="wp-block-heading"><strong>Networking and System Monitoring</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>ifconfig</td><td>Display network interface information.</td></tr><tr><td>ping &lt;hostname&gt;</td><td>Test network connectivity.</td></tr><tr><td>nslookup &lt;domain&gt;</td><td>Get DNS information for a domain.</td></tr><tr><td>netstat -tuln</td><td>Show open ports and network connections.</td></tr><tr><td>hostname</td><td>Display or set the system&#8217;s hostname.</td></tr><tr><td>curl &lt;url&gt;</td><td>Download files or interact with APIs.</td></tr><tr><td>scp &lt;file&gt; &lt;user@host:path&gt;</td><td>Securely copy files to a remote system.</td></tr><tr><td>rsync -avz &lt;source&gt; &lt;destination&gt;</td><td>Sync files between two locations.</td></tr></tbody></table></figure>



<h2 id="package-management-rpm-yum" class="wp-block-heading"><strong>Package Management (RPM/YUM)</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>rpm -ivh &lt;package.rpm&gt;</td><td>Install an RPM package.</td></tr><tr><td>rpm -qa</td><td>List installed RPM packages.</td></tr><tr><td>yum install &lt;package&gt;</td><td>Install software via YUM.</td></tr><tr><td>yum update &lt;package&gt;</td><td>Update installed software.</td></tr><tr><td>yum remove &lt;package&gt;</td><td>Remove software via YUM.</td></tr></tbody></table></figure>



<h2 id="scheduling-and-automation" class="wp-block-heading"><strong>Scheduling and Automation</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>crontab -e</td><td>Edit cron jobs for scheduling tasks.</td></tr><tr><td>crontab -l</td><td>List scheduled cron jobs.</td></tr><tr><td>systemctl start &lt;service&gt;</td><td>Start a system service.</td></tr><tr><td>systemctl stop &lt;service&gt;</td><td>Stop a system service.</td></tr><tr><td>systemctl status &lt;service&gt;</td><td>Check the status of a service.</td></tr></tbody></table></figure>



<h2 id="security-and-permissions" class="wp-block-heading"><strong>Security and Permissions</strong></h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td>chmod &lt;permissions&gt; &lt;file&gt;</td><td>Change file permissions (e.g., 755).</td></tr><tr><td>chown &lt;user&gt;:&lt;group&gt; &lt;file&gt;</td><td>Change file ownership.</td></tr><tr><td>ssh-keygen</td><td>Generate SSH key pairs.</td></tr><tr><td>ssh &lt;user@hostname&gt;</td><td>Connect to a remote system securely via SSH.</td></tr><tr><td>scp &lt;file&gt; &lt;remote_host:path&gt;</td><td>Securely copy files over SSH.</td></tr></tbody></table></figure>



<p>This Linux Command Cheat Sheet provides a quick reference to some of the most commonly used commands in Linux. Use it to improve your productivity and manage Linux systems more effectively. For deeper exploration of these commands, check out the man pages (man &lt;command&gt;)</p>
<p>The post <a href="https://awsprep.co/linux-cheat-sheet/">Linux Cheat Sheet</a> appeared first on <a href="https://awsprep.co">awsprep</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://awsprep.co/linux-cheat-sheet/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
