Linux Cheatsheet for DevOps
<p>As a DevOps engineer, you’re expected to know your way around Linux command line tools. This cheat sheet can help.</p>
<blockquote>
<p>Let’s get started! </p>
</blockquote>
<h1>Basic commands </h1>
<h2> mkdir</h2>
<p><code>mkdir linux-basics</code>: creates a new directory with the specified name.</p>
<p> </p>
<ul>
<li><code>mkdir dev qa prod</code> : creates multiple directories at once.</li>
<li><code>mkdir logfolder{1..10}</code> : creates a range of directories with sequential numbers from 1 to 10.</li>
</ul>
<p> </p>
<h2> sudo: stands for ‘superuser do’</h2>
<p><code>sudo [options] [cmd]</code>: It is used to execute commands as a root user or super user.</p>
<ul>
<li><code>sudo apt-get update</code> : updates the package list</li>
</ul>
<p> </p>
<ul>
<li><code>sudo -u username touch file.txt</code> : creates a new file “file.txt” with the ownership of “username”.</li>
</ul>
<p> </p>
<ul>
<li><code>sudo -s</code> : starts a new shell with root privileges.</li>
</ul>
<p> </p>
<h2>history</h2>
<p><code>history</code> : display all the commands which we have executed on a terminal.</p>
<p> </p>
<h2> ls</h2>
<p><code>ls</code> : list the contents of the current working directory</p>
<ul>
<li><code>ls -l</code> : list the content in long format with permissions, owner, size, and last modified date for each directory</li>
</ul>
<p><a href="https://keentolearn.medium.com/linux-cheatsheet-for-devops-e4f4cd4631aa">Click Here</a> </p>