Table of contents
Linux Commands:
ls
: List all the directories and files.mkdir
: Makes a new directory.rmdir
: Remove a directory (only if it's empty).cd
: Change directory.cd..
: Go back to the previous directory.pwd
: Print the current working directory.ls -l
: List files with more details.cat
: Show the content of a file.echo
: Shows the desired string and value.man
: Tells about all commands.touch
: Create a file.cp
: Copy files.mv
: Move files.rm
: Remove the file permanently.sudo
: Administrative commands (password).head
: Display the first 10 lines.tail
: Display the last 10 lines.zip
: Zip files in Linuxunzip
: Unzip files in Linuxssh
: Secure Shell command in Linuxservice
: Linux command to start and stop servicesps
: Display active processeswget
: download files from the internetwhoami
: Create or update passwords for existing usersgrep
: Search for a string within an outputsort
: sort the file contentcal
: View Calendar in terminalwhereis
: View the exact location of any command types after this commandkill and killall
: Kill active processes by process ID or namechmod
: Change file permissions.chown
: Change file ownership.history
: Shows history of command usage.useradd and usermod
: Add a new user or change existing users datapasswd
: Create or update passwords for existing users
Git-GitHub Commands:
git init
: Initialize a new Git repository in the current directory.git clone <repository-url>
: Clone a remote repository to your local machine.git status
: Show the current status of the repository (modified files, staged changes, etc.).git add <file>
: Add a file to the staging area to be included in the next commit.git commit -m "commit message"
: Create a new commit with the staged changes and a descriptive message.git diff
: View the differences between the working directory and the staging area.git log
: Display the commit history of the repository.git branch
: List all branches in the repository.git checkout <branch>
: Switch to a different branch.git merge <branch>
: Merge changes from the specified branch into the current branch.git pull
: Fetch and merge changes from a remote repository into the current branch.git push
: Push local commits to a remote repository.git remote add origin <repository-url>
: Add a remote repository as the origin (usually the main remote).git remote -v
: View a list of remote repositories and their URLs.git reset <file>
: Unstage changes for a file, removing them from the staging area.git rm <file>
: Remove a file from the repository and staging area.git stash
: Temporarily store changes not ready for a commit.git cherry-pick <commit>
: Apply changes from a specific commit to the current branch.git fetch
: Download objects and refs from another repository without merging.git revert <commit>
: Create a new commit that undoes the changes from a specific commit.git remote -v
: View a list of remote repositories and their URLs, including GitHub remotes.git push origin <branch>
: Push local commits to a remote branch on GitHub.git pull origin <branch>
: Fetch and merge changes from a remote branch on GitHub into the current branch.git clone <repository-url>
: Clone a GitHub repository to your local machine.git fork
: Create a copy of a repository on your GitHub account (forking).git pull-request
: Create a pull request to propose changes from your fork to the original repository.git pull upstream <branch>
: Pull changes from the original repository after forking (upstream).git remote add upstream <original-repo-url>
: Add the original repository as the upstream remote for your fork.git branch -d <branch>
: Delete a local branch after it's merged and no longer needed.git push origin --delete <branch>
: Delete a remote branch on GitHub.
I hope you like my blog..!!
Stay Connected with me for more interesting articles on DevOps, if you like my blog follow me on Hashnode and Linkedin (https://www.linkedin.com/in/som-shanker-pandey/)