Linux Cheatsheet for DevOps

<p>As a DevOps engineer, you&rsquo;re expected to know your way around Linux command line tools. This cheat sheet can help.</p> <blockquote> <p>Let&rsquo;s get started!&nbsp;</p> </blockquote> <h1>Basic commands&nbsp;</h1> <h2>&nbsp;mkdir</h2> <p><code>mkdir linux-basics</code>: creates a new directory with the specified name.</p> <p>&nbsp;</p> <ul> <li><code>mkdir dev qa prod</code>&nbsp;: creates multiple directories at once.</li> <li><code>mkdir logfolder{1..10}</code>&nbsp;: creates a range of directories with sequential numbers from 1 to 10.</li> </ul> <p>&nbsp;</p> <h2>&nbsp;sudo: stands for &lsquo;superuser do&rsquo;</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>&nbsp;: updates the package list</li> </ul> <p>&nbsp;</p> <ul> <li><code>sudo -u username touch file.txt</code>&nbsp;: creates a new file &ldquo;file.txt&rdquo; with the ownership of &ldquo;username&rdquo;.</li> </ul> <p>&nbsp;</p> <ul> <li><code>sudo -s</code>&nbsp;: starts a new shell with root privileges.</li> </ul> <p>&nbsp;</p> <h2>history</h2> <p><code>history</code>&nbsp;: display all the commands which we have executed on a terminal.</p> <p>&nbsp;</p> <h2>&nbsp;ls</h2> <p><code>ls</code>&nbsp;: list the contents of the current working directory</p> <ul> <li><code>ls -l</code>&nbsp;: 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>&nbsp;</p>