12 Day: Linux & Git-GitHub Cheat Sheet
|| DevOps And Cloud Lerner âžď¸ | CI/CD | Linux đ§ | Terraform đď¸ | Jenkins đ ď¸ | Shell Scripting | Docker đł | K8sâ¸ď¸ | Ansible | Prometheus | AWS âď¸ | Git & GitHub | Python đ||
Here s a cheat sheet for commonly used Linux and Git/GitHub commands:
Linux Cheat Sheet:
File and Directory Operations:
ls: List files and directories.pwd: Print the working directory.cd: Change directory.mkdir: Create a new directory.touch: Create an empty file.rm: Remove files or directories.cp: Copy files or directories.mv: Move or rename files or directories.
File Manipulation:
cat: Display the contents of a file.moreorless: View file content page by page.head: Display the beginning of a file.tail: Display the end of a file.nanoorvimoremacs: Text editors to edit files.
File Permissions:
chmod: Change file permissions.chown: Change file ownership.
Process Management:
ps: List running processes.kill: Terminate processes.toporhtop: Monitor system resources and processes.
Package Management:
apt(Debian/Ubuntu) oryum(Fedora/CentOS): Install and manage software packages.
Networking:
ifconfigorip: Network configuration.ping: Test network connectivity.ssh: Secure shell for remote access.scp: Securely copy files over SSH.
User Management:
useradd: Create a new user.passwd: Change user password.suorsudo: Switch users or run commands with superuser privileges.
File Compression and Archiving:
tar: Archive files.gziporbzip2: Compress files.ziporunzip: Create or extract ZIP archives.
Git & GitHub Cheat Sheet:
Git Basics:
git init: Initialize a new Git repository.git clone: Clone a remote repository.git add: Stage changes for commit.git commit: Commit changes.git status: Check the status of the repository.git log: View commit history.git branch: List branches.git checkout: Switch branches or commit versions.git merge: Merge branches.git pull: Fetch and merge changes from a remote repository.git push: Push local changes to a remote repository.
GitHub Commands:
git remote add origin <repository_url>: Link your local repository to a GitHub repository.git push -u origin <branch_name>: Push your branch to GitHub.Pull requests, issues, and other GitHub-specific actions are typically performed through the GitHub web interface.
Git Branching and Merging:
git branch <branch_name>: Create a new branch.git checkout -b <branch_name>: Create and switch to a new branch.git merge <branch_name>: Merge a branch into the current branch.git rebase <branch_name>: Rebase the current branch onto another branch.
Git Collaboration:
git fetch: Retrieve remote changes without merging.git pull: Fetch and merge remote changes.git fetch --allandgit pull --all: Fetch and merge from all remote repositories.git clone --recursive: Clone a repository and its submodules.
Remember to replace placeholders like <repository_url> and <branch_name> with the actual values you're working with. This cheat sheet should help you get started with common Linux and Git/GitHub commands.



