🚀Day 12 - Linux & Git Cheat-Sheet 💻

🐧 Linux Cheat-Sheet:
Navigation:
pwd: Print the current working directoryls: List directory contentsls -l: Long listing formatls -a: Show hidden filescd: Change directorymkdir: Create a directoryrmdir: Remove an empty directorycp:Description: Copy files or directoriesmv: Move or rename files/directories.rm: Remove files/directoriescat: Description: Concatenate and display file content.more: Display content one screen at a time.less: Display content with navigation capabilities.
File Operations:
touch: Create an empty filecp: Copy files or directoriesmv: Move or rename files/directoriesrm: Remove files/directoriesrm -r: Remove the directory and its contentscat: Concatenate and display file contentnanoorvim: Text editorsvim: Powerful text editor with modes.head: Display the first few lines of a file.tail: Display the last few lines of a file.
Permissions:
chmod: Change file permissionschown: Change file ownerchgrp: Change file-groupunmask: Set default permissionssu: Switch usersudo: Execute a command as a superuserpasswd: Change user password.id: Display user and group information.groups: Display groups a user is a memberadduser: Create a new userdeluser: Delete a useraddgroup: Create a new groupdelgroup: Delete a group
System Information:
uname: Display system informationdf: Show disk space usagefree: Display system memory usagehostname: Print or set system namewhoami: Print the effective usernamedu: Display file and directory space usageps: Display information about processesfree: Display the amount of free and used memorytop: Display and update sorted information aboutuptime: Display how long the system has been runningdate: Display or set the system date and timelsblk: List information about block deviceslscpu: Display information about the CPU architecture
Process Management:
ps: Display information about active processestop: Display and update sorted information about processeskill: Terminate a processkill -9: Forcefully terminate a processuptime: Display how long the system has been
🐙 Git-GitHub Command Cheat Sheet:
Basic Commands:
git init: Initialize a new Git repositorygit clone: Clone a repository into a new directorygit add: Add changes to the staging areagit commit: Record changes to the repositorygit commit -m "message": Commit with a messagegit status: Show the working tree statusgit log: Display commit historygit diff: Show changes between commitsgit merge: Join two or more development histories togethergit remote: Manage a set of tracked repositories.git push: Update remote refs along with the associatedgit pull: Fetch from and integrate with another repository
Branching:
git branch: List, create, or delete branchesgit branch branch_name: Create a new branchgit branch -d branch_name: Delete a branchgit checkout: Switch branches or restore working tree filesgit checkout -b branch_name: Create and switch to a new branchgit switch: Switch branches.git restore: Restore working tree files.
Merging and Rebasing:
git merge: Join two or more development histories togethergit merge branch_name: Merge changes from a branchgit rebase: Reapply commits on top of another base tipgit rebase branch_name: Rebase the current branch onto another
Remote Repositories:
git remote: Manage a set of tracked repositoriesgit fetch: Download objects and refs from another repositorygit pull: Fetch from and integrate with another repository or a local branchgit push: Update remote refs along with associated objects
Happy Learning....! 😎





