DevOps Mastery: Linux & Git-GitHub Commands Cheat Sheet ๐Ÿš€

DevOps Mastery: Linux & Git-GitHub Commands Cheat Sheet ๐Ÿš€

ยท

2 min read

Linux Commands:

Navigation Commands:

  • pwd: Print working directory.

  • ls: List files and directories.

  • cd: Change directory.

  • mkdir: Create a new directory.

  • rmdir: Remove an empty directory.

File Operations:

  • touch: Create an empty file.

  • cp: Copy files or directories.

  • mv: Move or rename files or directories.

  • rm: Remove files or directories.

  • cat: Display file content.

User and Permission Management:

  • whoami: Display the current user.

  • sudo: Execute a command with superuser privileges.

  • chmod: Change file permissions.

  • chown: Change file owner.

Process Management:

  • ps: Display information about running processes.

  • kill: Terminate a process.

  • top: Display real-time system statistics.

System Information:

  • uname: Display system information.

  • df: Display disk space usage.

  • free: Display system memory usage.

Text Manipulation:

  • echo: Print text to the terminal.

  • grep: Search for patterns in files.

  • sed: Stream editor for filtering and transforming text.

  • awk: Powerful text processing tool.

Git-GitHub Commands:

Basic Git Commands:

  • git init: Initialize a new Git repository.

  • git clone: Clone a repository into a new directory.

  • git add: Add changes to the staging area.

  • git commit: Record changes to the repository.

  • git status: Display the status of the working directory.

Branching and Merging:

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

  • git checkout: Switch branches or restore working tree files.

  • git merge: Merge branches.

  • git rebase: Reapply commits on top of another base commit.

Remote Repositories:

  • git remote: Manage set of tracked repositories.

  • git fetch: Download objects and refs from another repository.

  • git pull: Fetch from and integrate with another repository or a local branch.

  • git push: Update remote refs along with associated objects.

Undoing Changes:

  • git reset: Reset current HEAD to the specified state.

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

  • git stash: Stash changes in a dirty working directory.

Viewing History:

  • git log: Display the commit history.

  • git show: Show various types of objects.

  • git blame: Show what revision and author last modified each line of a file.

ย