Skip to main content

Command Palette

Search for a command to run...

Day 12 : Mastering Linux & Git-GitHub: A Comprehensive Cheat Sheet

Published
2 min read

Today we have the challenge to make a cheatsheet for Linux and Git. I will try to keep it simple as I can.

Section 1: Linux Command Cheat Sheet

  1. File Operations:

    • ls: List files and directories.

    • cd: Change directory.

    • pwd: Print working directory.

    • mkdir: Create a new directory.

    • rm: Remove files and directories.

    • cp: Copy files and directories.

    • mv: Move or rename files and directories.

  2. File Permissions:

    • chmod: Change file permissions.

    • chown: Change file ownership.

    • chgrp: Change group ownership.

  3. Package Management:

    • apt: Advanced Package Tool for Debian-based systems.

    • yum: Package manager for Red Hat-based systems.

    • dnf: Next-generation package manager (Fedora).

  4. Process Management:

    • ps: Display running processes.

    • kill: Terminate a process.

    • top: Monitor system processes.

  5. Networking:

    • ping: Send ICMP echo requests to a network host.

    • ifconfig / ip: Display or configure network interfaces.

    • ssh: Secure shell for remote login.

  6. File Manipulation:

    • cat: Concatenate and display file content

    • head: Display the first lines of a file

    • tail: Display the last lines of a file

    • grep: Search for patterns in files

    • awk: Process text files and data streams

    • sed: Stream editor for text transformation

Section 2: Git-GitHub Command Cheat Sheet

  1. Repository Operations:

    • git init: Create a new Git repository.

    • git clone: Clone a remote repository to your local machine.

    • git add: Add files to the staging area.

    • git commit: Commit changes to the repository.

    • git push: Push local commits to a remote repository.

    • git pull: Fetch changes from a remote repository and merge them.

  2. Branching and Merging:

    • git branch: List, create, or delete branches.

    • git checkout: Switch between branches.

    • git merge: Merge branches together.

    • git rebase: Reapply commits on top of another branch.

  3. Remote Operations:

    • git remote: Manage remote repositories.

    • git fetch: Fetch changes from a remote repository.

    • git remote add: Add a new remote repository.

    • git remote remove: Remove a remote repository.

  4. Collaboration:

    • git pull-request: Create a pull request on GitHub.

    • git clone: Clone a repository from GitHub.

    • git fork: Create a personal copy of a repository on GitHub.

    • git branch -d: Delete a branch after it's merged.

Feel free to print out this cheat sheet or keep it handy for quick reference. Happy Linux and Git-GitHub coding! 🚀💻

More from this blog

Ajay Patel

116 posts