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

cdChange the current working directory.lsList files and directories.
pwdPrint the current working directory.cpCopy files and directories.
echoDisplay a message.mvMove or rename files and directories.
historyDisplay a list of previously executed commands.rmRemove files.
exitTerminate the current shell session.mkdirCreate a new directory.
typeDisplay information about a command.rmdirRemove a directory.
bgPut a job in the background.catConcatenate and display files.
killSend a signal to a process to terminate it.touchCreate an empty file.
waitWait for a process to complete.chmodChange file permissions.
readRead a line of input from the user.chownChange file ownership.
printfFormat and print a message to the console.psDisplay information about running processes.
testEvaluate expressions and test file types.topDisplay real-time system resource usage.
suSwitch to another user account.dfDisplay disk space usage.
sudoExecute a command with administrative privileges.duDisplay disk usage by file or directory.
whoamiDisplay the username of the current user.tarArchive files and directories into a single file.
whichLocate the executable file of a command.zip/unzipCompress and decompress files and directories.
unameDisplay system information.pingTest network connectivity to a server or device.
manDisplay the manual page of a command.ifconfig/ipDisplay network interface information.
grepSearch for a specific string in a file or files.sshConnect to a remote server securely.
findSearch for files and directories that match specific criteria.scpCopy files securely between remote servers.
calPrint a calendar.clearClear the screen.

Git & GitHub

Command

Description

Command

Description

git initInitializes a new Git repository in the current directory.git configConfigures Git settings.
git cloneClones a Git repository from a remote location to your local machine.git cleanRemoves untracked files from the working directory.
git addAdds changes to the staging area.git rmRemoves a file from the repository and working directory.
git commitRecords changes to the repository along with a message.git cherry-pickApplies changes from a specific commit to the current branch.
git pushSends committed changes to a remote repository.git log --onelineShows each commit in a single line.
git pullFetches and merges changes from a remote repository.git remote addAdds a new remote repository.
git statusShows the status of the working directory and staging area.git showShows the details of a specific commit.
git branchLists all branches in the repository.git tagCreates a new tag at a specific commit.
git checkoutSwitches to a different branch.git revertReverts a commit by creating a new commit with the reverse changes.
git checkout -bCreates a new branch and switches to it.git resetUnstages changes from the staging area.
git mergeMerges changes from one branch into another.git stashTemporarily stores changes in a stack to be applied later.
git remoteShows a list of all remote repositories.git diffShows the difference between the working directory, staging area, and repository.
git fetchFetches changes from a remote repository without merging.git log --grepFilters the commit log based on a specific text string.

Entradas relacionadas: