Cheat Sheet for Linux and Git-GitHub

·

2 min read

#day12 of #90daysofDEVOPS

Hey there, DevOps enthusiasts! 🚀 If you’ve been on the Linux and Git-GitHub ride with me, kudos! Now, let’s channel that hard-earned knowledge into something truly powerful: your very own cheat sheet. Think of it as your trusty sidekick in the world of DevOps.

This cheat sheet isn’t just for you — it’s for the whole DevOps community. Together, let’s explore the essential commands you’ve mastered and how they can shape our DevOps journey. Ready to dive in? Let’s make magic happen.

Linux Commands:

  1. pwd (Print Working Directory):
  • Displays the current directory path
$ pwd

ls (List):

  • Lists files and directories in the current directory.
$ ls

cd (Change Directory):

  • Navigates into a specified directory.
$ cd <directory_name>

cp (Copy):

  • Copies files or directories.
$ cp <source> <destination>

mv (Move):

  • Moves files or directories.
$ mv <source> <destination>

rm (Remove):

  • Deletes files or directories.
$ rm <file_name>

mkdir (Make Directory):

  • Creates a new directory.
$ mkdir <directory_name>

chmod (Change Mode):

  • Modifies file permissions.
$ chmod <permissions> <file_name>

grep (Global Regular Expression Print):

  • Searches for a pattern in files.
$ grep <pattern> <file_name>

Git-GitHub Commands:

git init:

  • Initializes a new Git repository.
$ git init

git clone:

  • Clones a repository into a new directory.
$ git clone <repository_url>

git add:

  • Adds changes to the staging area.
$ git add <file_name>

git commit:

  • Records changes to the repository.
$ git commit -m "Commit message"

git push:

  • Pushes changes to a remote repository.
$ git push <remote_name> <branch_name>

git pull:

  • Fetches changes from a remote repository
$ git pull <remote_name> <branch_name>

git branch:

  • Lists, creates, or deletes branches.
$ git branch

git merge:

  • Merges changes from one branch to another.
$ git merge <branch_name>

Crafting Your Cheat Sheet:

Now that we have these commands in our arsenal, let’s structure our cheat sheet for easy access and understanding. We’ll organize them by functionality to make navigation a breeze. Each command will come with a brief explanation of its purpose and how to use it. Think of it as our go-to playbook for smoother DevOps workflows. Let’s dive in and simplify our journey together.

Â