Cheat-sheet for Linux & Git-GitHub

Cheat-sheet for Linux & Git-GitHub

ยท

2 min read

Certainly! Here's a "cheat sheet" with some commonly used commands in Linux and Git/GitHub, along with brief descriptions to make it fun and memorable:

Linux Commands ๐Ÿง

File and Directory Operations:

  • ls: List files and directories.

  • pwd: Print working directory.

  • cd: Change directory.

  • mkdir: Create a new directory.

  • touch: Create an empty file.

  • cp: Copy files or directories.

  • mv: Move or rename files or directories.

  • rm: Remove files or directories.

File Manipulation:

  • cat: Concatenate and display file content.

  • nano: Open a text editor.

  • grep: Search for text in files.

  • chmod: Change file permissions.

  • chown: Change file ownership.

System Information:

  • uname: Display system information.

  • top: Display system resource usage.

  • df: Show disk space usage.

  • free: Display memory usage.

  • ps: List running processes.

Package Management:

  • apt-get: Package manager for Debian-based systems.

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

User and Permissions:

  • useradd: Add a new user.

  • passwd: Change user password.

  • sudo: Execute commands with superuser privileges.

Networking:

  • ifconfig: Show network interfaces.

  • ping: Send network requests to a host.

  • ssh: Securely access remote servers.

  • netstat: Network statistics.

Git/GitHub Commands ๐Ÿš€

Git Basics:

  • git init: Initialize a Git repository.

  • git clone: Clone a remote repository.

  • git add: Add changes to the staging area.

  • git commit: Commit changes with a message.

  • git status: Show the status of your repository.

Branching:

  • git branch: List branches.

  • git checkout: Switch branches.

  • git merge: Merge branches.

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

Remote Collaboration:

  • git remote: Manage remote repositories.

  • git push: Push changes to a remote repository.

  • git fetch: Fetch changes from a remote repository.

Undoing Changes:

  • git reset: Unstage changes.

  • git revert: Create a new commit that undoes changes.

  • git checkout -- <file>: Discard local changes to a file.

Viewing History:

  • git log: Show commit history.

  • git blame: Display who last modified each line.

GitHub:

  • git remote add origin <repository_url>: Link a local repo to a remote GitHub repository.

  • git push origin <branch_name>: Push local changes to a GitHub branch.

  • git pull origin <branch_name>: Pull changes from a GitHub branch.

  • git clone <repository_url>: Clone a GitHub repository.

Remember to replace <repository_url> and <branch_name> with your specific GitHub repository URL and branch names.

Feel free to expand on this cheat sheet by adding more commands and descriptions as needed. Happy Linux and Git/GitHub adventures! ๐Ÿง๐Ÿš€

ย