Cheat sheet for Linux, Git-GitHub commands

Linux Commands:
Navigation:
cd: Change directory.ls: List files and directories.pwd: Print working directory.mkdir: Make a new directory.rmdir: Remove an empty directory.rm: Remove files or directories.
File Operations:
touch: Create an empty file.cp: Copy files or directories.mv: Move or rename files or directories.cat: Concatenate and display file contents.less: View file content with pagination.head: Display the beginning of a file.tail: Display the end of a file.
System Information:
top: Display system processes.ps: Display currently running processes.df: Display disk space usage.free: Display memory usage.uname: Print system information.
Permissions:
chmod: Change file permissions.chown: Change file ownership.chgrp: Change group ownership.
Networking:
ping: Send ICMP echo requests to a host.ifconfigorip: Network interface configuration.ssh: Secure shell remote login.scp: Securely copy files between hosts.
Text Editing with Nano:
nano: Open the nano text editor.Ctrl + O: Save the file.Ctrl + X: Exit the editor.Ctrl + G: Display help.Ctrl + K: Cut the current line.Ctrl + U: Paste the cut line.
Cron Jobs:
crontab -e: Edit the current user's cron jobs.* * * * * command: Schedule a cron job with the desired command.The five
*represent the minute, hour, day of the month, month, and day of the week fields.For example,
0 2 * * *would run the command at 2:00 AM daily.
Remember to use sudo for commands that require administrative privileges. Be cautious when using rm and other destructive commands. Always verify before proceeding.
Git Commands:
Configuration:
git config: Set or view Git configurations.git init: Initialize a new Git repository.git clone: Clone a remote repository to a local machine.
Basic Workflow:
git add: Add changes to the staging area.git commit: Commit changes from the staging area to the repository.git status: Show the working tree status.git diff: Show changes between commits or working tree and staging area.git log: View commit history.
Branching and Merging:
git branch: List, create, or delete branches.git checkout: Switch branches or restore working tree files.git merge: Merge changes from one branch into another.git cherry-pick: Apply a specific commit from one branch to the current branch.
Stashing Changes:
git stash: Temporarily save changes to a stack.git stash list: List stashed changes.git stash apply: Apply the most recent stash and keep it in the stack.git stash pop: Apply the most recent stash and remove it from the stack.
Rebasing:
git rebase: Reapply commits on top of another base commit.git rebase -i: Interactive rebase to modify, squash, or reorder commits.
Remote Repositories:
git remote: Manage set of tracked repositories.git fetch: Download objects and refs from another repository.git pull: Fetch and integrate changes from a remote repository.git push: Update remote refs along with associated objects.
GitHub Commands:
Working with GitHub:
git remote add: Add a remote repository (GitHub) as a named alias.git push origin: Push changes to a remote repository (GitHub).git pull origin: Pull changes from a remote repository (GitHub).git clone: Clone a GitHub repository to a local machine.
Collaboration:
git pull request: Create or view a pull request on GitHub.git fetch: Download objects and refs from another repository (GitHub).
🚀Congratulations on reaching the end of our comprehensive cheat sheet for Linux and Git-GitHub! We hope this blog has been a valuable resource for both beginners and seasoned developers, helping you streamline your development process and enhance your productivity.




