CheatSheet :)

CheatSheet  :)

Linux:-

  1. File and Directory Operations:

    • ls: List files and directories in the current directory.

    • pwd: Print the working directory.

    • cd: Change the current directory.

    • touch <filename>: Create an empty file.

    • mkdir <dirname>: Create a new directory.

    • rm <file or dir>: Remove a file or directory (use with caution).

    • mv <source> <destination>: Move or rename files and directories.

    • cp <source> <destination>: Copy files and directories.

  2. File Viewing and Editing:

    • cat <file>: Display the content of a file.

    • more <file> or less <file>: View a file one screen at a time.

    • nano <file> or vim <file>: Open a text editor to create or edit files.

  3. File Permissions:

    • chmod <permissions> <file>: Change file permissions.

    • chown <user>:<group> <file>: Change file ownership.

  4. Searching and Finding:

    • grep <pattern> <file>: Search for text in files.

    • find <directory> -name <filename>: Find files and directories.

  5. Process Management:

    • ps: List running processes.

    • top or htop: Monitor system activity and processes.

    • kill <PID>: Terminate a process by its Process ID.

  6. Package Management:

    • apt-get or apt (Debian/Ubuntu): Package management commands for installing, updating, and removing software.

    • yum (Red Hat/CentOS): Package management commands.

  7. Networking:

    • ifconfig or ip a: Display network interface information.

    • ping <hostname or IP>: Check network connectivity.

    • netstat: Network statistics.

    • ssh <user>@<host>: Securely connect to a remote server.

  8. Archiving and Compression:

    • tar: Archive files and directories.

    • gzip, gunzip, zip, unzip: Compress and decompress files.

  9. System Information:

    • uname -a: Display system information.

    • df: Show disk space usage.

    • free: Display available memory.

  10. User and Group Management:

    • useradd, userdel, usermod: Manage user accounts.

    • groupadd, groupdel, groupmod: Manage user groups.

  11. File Transfer:

    • scp: Securely copy files between hosts.

    • rsync: Synchronize files and directories.

  12. System Control:

    • reboot: Reboot the system.

    • shutdown: Shut down the system.

Git-Github

Git Commands:

  1. Initializing a Git Repository:

    • git init: Initialize a new Git repository in the current directory.
  2. Cloning a Repository:

    • git clone <repository URL>: Clone a remote Git repository to your local machine.
  3. Working with Changes:

    • git status: View the status of your working directory.

    • git add <file>: Stage changes for commit.

    • git reset <file>: Unstage changes.

    • git diff: Show the differences between the working directory and the staging area.

  4. Committing Changes:

    • git commit -m "Your commit message": Commit staged changes with a descriptive message.

    • git commit -a -m "Your commit message": Stage and commit all changes in one command.

  5. Branching:

    • git branch: List all local branches.

    • git branch <branch-name>: Create a new branch.

    • git checkout <branch-name>: Switch to a different branch.

    • git merge <branch-name>: Merge changes from one branch into the current branch.

  6. Stashing Changes:

    • git stash: Temporarily save changes that are not ready to be committed.
  7. Viewing History:

    • git log: View commit history.

    • git log --oneline: View a simplified commit history.

  8. Working with Remotes:

    • git remote -v: List remote repositories.

    • git remote add <name> <URL>: Add a new remote repository.

    • git push <remote> <branch>: Push local changes to a remote repository.

    • git pull <remote> <branch>: Pull changes from a remote repository.

GitHub Commands:

  1. GitHub Workflow:

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

    • git push origin main: Push changes to the main branch on GitHub.

  2. Collaboration:

    • Fork a repository on GitHub: Create your own copy of a repository to work on.

    • Create a Pull Request (PR): Propose changes to the original repository.

    • Review and merge PRs: Collaborate with others to merge changes into the original repository.

  3. GitHub Issues:

    • Create issues: Track and discuss tasks or problems.

    • Mentioning issues: Reference issues in commits or comments using #.

  4. GitHub Actions:

    • Automate workflows using GitHub Actions for continuous integration and more.

Day 12 of #90daysofDevOps

Thanks for reading

Follow me for more about DevOps♾️........

________________________________________________________________________________

#90daysHardChallenge

#Cloudcomputing

#DevOps

#Kubernetes

#TrainWithShubham