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