Linux & Git-GitHub Cheat-sheet
Day 12 : #90DaysOfDevOps Challange

Passionate about building secure, scalable cloud environments. I specialize in AWS & Azure, with hands-on experience in DevOps automation, Python scripting, and infrastructure as code using Terraform.
Currently working in Cloud Security, where I focus on securing cloud-native architectures, implementing security best practices, and automating compliance workflows.
Always open to collaborating on innovative cloud projects that blend automation, security, and performance.
Linux Command Shell Scripting Cheatsheet:
- Basic commands:
ls: lists files and directoriescd: changes directorypwd: prints the working directorymkdir: creates a new directoryrm: removes files or directoriescp: copies files or directoriesmv: moves files or directoriescat: displays file contentsgrep: searches for a pattern in a file or outputecho: prints a message to the terminalchmod: changes file permissionssudo: executes a command as the superuser
- Variables:
To define a variable:
variable_name=valueTo access a variable:
$variable_nameTo use arithmetic operations:
$(($variable_name + 1))
- Control structures:
ifstatement:
if [ condition ]; then
command1
else
command2
fi
forloop:
for variable in list; do
command
done
whileloop:
while [ condition ]; do
command
done
- Functions:
- To define a function:
function_name() {
command1
command2
}
- To call a function:
function_name
- Input/output:
readcommand: reads input from the user
read variable_name
echocommand: prints output to the terminal
echo "message"
Git and GitHub Cheatsheet:
- Basic commands:
git init: initializes a new Git repositorygit clone: clones a remote Git repositorygit add: adds changes to the staging areagit commit: commits changes to the repositorygit push: pushes changes to a remote repositorygit pull: pulls changes from a remote repositorygit status: displays the status of the repositorygit log: displays the commit history
- Branching:
git branch: lists all branchesgit branch branch_name: creates a new branchgit checkout branch_name: switches to a different branchgit merge branch_name: merges a branch into the current branch
- Collaboration:
git remote: lists all remote repositoriesgit remote add remote_name remote_url: adds a new remote repositorygit fetch: fetches changes from a remote repositorygit merge origin/branch_name: merges changes from a remote branch into the current branchgit pull --rebase: pulls changes from a remote repository and rebases local changes on top
- GitHub:
git push -u origin branch_name: pushes a new branch to a remote repositorygit pull-request: creates a new pull requestgit remote add upstream upstream_url: adds the original repository as a remote upstreamgit fetch upstream: fetches changes from the original repositorygit merge upstream/master: merges changes from the original repository into the current branch
Note: It's important to ensure that your changes are well tested before pushing to the remote repository, and to always fetch and merge changes before pushing your own changes to prevent conflicts.


