🚀Day 12 - Linux & DevOps Commands Cheat-Sheet 💻

🚀Day 12 - Linux & DevOps Commands Cheat-Sheet 💻

💻Linux Commands:

  1. ls: List directory contents. Usage: ls [options] [file/directory]

    • -l: Long listing format.

    • -a: Include hidden files.

    • -h: Human-readable sizes.

  2. cd: Change directory. Usage: cd [directory]

    • cd ~: Navigate to the home directory.

    • cd ..: Move up one directory.

  3. pwd: Print working directory. Usage: pwd

    • Displays the current directory path.
  4. mkdir: Make directory. Usage: mkdir [directory]

    • mkdir -p: Create parent directories if they do not exist.
  5. rm: Remove files or directories. Usage: rm [options] [file/directory]

    • -r: Recursive deletion for directories.

    • -f: Force deletion without confirmation.

  6. grep: Search text. Usage: grep [options] [pattern] [file]

    • -i: Ignore case.

    • -r: Recursive search in directories.

  7. chmod: Change file permissions. Usage: chmod [options] [permissions] [file]

    • chmod +x filename: Make a file executable.

💻Git Commands:

  1. git init: Initialize a Git repository. Usage: git init

  2. git clone: Clone a repository into a new directory. Usage: git clone [repository_url]

    • git clone [repository_url] [directory_name]: Clone with a different directory name.
  3. git add: Add file changes to the staging area. Usage: git add [file(s)]

    • git add .: Add all changes in the current directory.
  4. git commit: Record changes to the repository. Usage: git commit -m "Commit message"

    • -m: Specify a commit message.
  5. git push: Update remote refs. Usage: git push [remote] [branch]

    • git push origin main: Push changes to the main branch on the origin remote.
  6. git pull: Fetch from and integrate with another repository or a local branch. Usage: git pull [remote] [branch]

    • git pull origin main: Pull changes from the main branch on the origin remote.

💻GitHub Commands:

  1. git remote: Manage set of tracked repositories. Usage: git remote [options] [command] [remote_name] [remote_url]

    • git remote add origin [repository_url]: Add a remote named origin.
  2. git branch: List, create, or delete branches. Usage: git branch [options] [branch_name]

    • git branch -d [branch_name]: Delete a branch.
  3. git checkout: Switch branches or restore working tree files. Usage: git checkout [branch_name]

    • git checkout -b [new_branch]: Create and switch to a new branch.
  4. git merge: Join two or more development histories together. Usage: git merge [branch_name]

    • git merge [source_branch] [target_branch]: Merge changes from source to target branch.

This cheat sheet covers essential commands for Linux, Git, and GitHub, providing a quick reference for developers and DevOps professionals. Feel free to share and spread the knowledge! 🌟

😊Enjoy Learning:)

Did you find this article valuable?

Support PratikM's Blog by becoming a sponsor. Any amount is appreciated!