Essential Linux & Git Commands: A Quick Reference
Classified in Design and Engineering
Written at on English with a size of 5.77 KB.
Linux
Command | Description | Command | Description |
---|---|---|---|
cd | Change the current working directory. | ls | List files and directories. |
pwd | Print the current working directory. | cp | Copy files and directories. |
echo | Display a message. | mv | Move or rename files and directories. |
history | Display a list of previously executed commands. | rm | Remove files. |
exit | Terminate the current shell session. | mkdir | Create a new directory. |
type | Display information about a command. | rmdir | Remove a directory. |
bg | Put a job in the background. | cat | Concatenate and display files. |
kill | Send a signal to a process to terminate it. | touch | Create an empty file. |
wait | Wait for a process to complete. | chmod | Change file permissions. |
read | Read a line of input from the user. | chown | Change file ownership. |
printf | Format and print a message to the console. | ps | Display information about running processes. |
test | Evaluate expressions and test file types. | top | Display real-time system resource usage. |
su | Switch to another user account. | df | Display disk space usage. |
sudo | Execute a command with administrative privileges. | du | Display disk usage by file or directory. |
whoami | Display the username of the current user. | tar | Archive files and directories into a single file. |
which | Locate the executable file of a command. | zip/unzip | Compress and decompress files and directories. |
uname | Display system information. | ping | Test network connectivity to a server or device. |
man | Display the manual page of a command. | ifconfig/ip | Display network interface information. |
grep | Search for a specific string in a file or files. | ssh | Connect to a remote server securely. |
find | Search for files and directories that match specific criteria. | scp | Copy files securely between remote servers. |
cal | Print a calendar. | clear | Clear the screen. |
Git & GitHub
Command | Description | Command | Description |
---|---|---|---|
git init | Initializes a new Git repository in the current directory. | git config | Configures Git settings. |
git clone | Clones a Git repository from a remote location to your local machine. | git clean | Removes untracked files from the working directory. |
git add | Adds changes to the staging area. | git rm | Removes a file from the repository and working directory. |
git commit | Records changes to the repository along with a message. | git cherry-pick | Applies changes from a specific commit to the current branch. |
git push | Sends committed changes to a remote repository. | git log --oneline | Shows each commit in a single line. |
git pull | Fetches and merges changes from a remote repository. | git remote add | Adds a new remote repository. |
git status | Shows the status of the working directory and staging area. | git show | Shows the details of a specific commit. |
git branch | Lists all branches in the repository. | git tag | Creates a new tag at a specific commit. |
git checkout | Switches to a different branch. | git revert | Reverts a commit by creating a new commit with the reverse changes. |
git checkout -b | Creates a new branch and switches to it. | git reset | Unstages changes from the staging area. |
git merge | Merges changes from one branch into another. | git stash | Temporarily stores changes in a stack to be applied later. |
git remote | Shows a list of all remote repositories. | git diff | Shows the difference between the working directory, staging area, and repository. |
git fetch | Fetches changes from a remote repository without merging. | git log --grep | Filters the commit log based on a specific text string. |