Skip to main content

Command Palette

Search for a command to run...

Cheatsheet For Linux and Git -Github commands🔥

Published
3 min readView as Markdown
Cheatsheet  For Linux and Git -Github commands🔥

✅Linux Commands

ls: lists all the contents in the current working directory.

sudo: executes only that command with root/ superuser privileges.

cat: read, modify, or concatenate text files. It also displays file contents.

grep: search for a particular string or word in a text file.

sort: sorts the results of a search either alphabetically or numerically. It also sorts files, file contents, and directories.

tail: It is complementary to the head command. The tail command, as the name implies, prints the last N number of data of the given input.

chown: it is used to change the file Owner or group.

chmod: This command is used to change the access permissions of files and directories.

lsof: It stands for List of open files. This command provides a list of files that are opened.

ifconfig: It is used to assign the IP address and netmask to an interface or to enable or disable a given interface.

id: id command is used to find out the user, group names, and numeric IDs of the current user or any other user in the server.

Cut: This command is used for extracting a portion of a file using columns and delimiters.

Sed: sed is a text editor that can perform editing operations in a non-interactive way.

diff: This command is used to find the difference between two files.

history: it is used to view the previously executed command.

find: This command is used to find files and directories.

Cp: This command is used to copy files and directories.

rm: remove files from a directory.

man: Display the user manual of any command that we can run on the terminal.

whoami: display the username of the current user.

Systemctl: gives information about the system service.

SSH: access remote servers.

pwd: display present working directory.

scp: securely transfer files from a local to a remote server or vice-versa.

mv: move a file from one directory to another directory.

tar: zip a file.

unique: filtering duplicate lines from a file.

watch: execute the program periodically showing output in full screen.

free: displays the total amount of free space available along with the amount of memory used.

ip: perform network administration task.

env: print environment variable.

DF: reports the amount of available disk space being used by the file systems.

wc: counts words and lines.

✅Git Commands

git config: we can set up user name, and email id in git.

git init: initialize an empty repository locally.

git clone: clones the repository from a remote URL and transfers it to the local.

git add: add a file to the staging area.

git commit: records or snapshots the files permanently in the version history.

git rm: remove files from the git repository.

git show: display metadata and the content of the specified commits.

git remote: used to connect local repositories to the remote server.

git branch: create a new branch and show all the branch names.

git pull: fetches and merges change on the remote server to the working

directory.

git push: all the files were uploaded to a remote server which was committed in git.

git checkout: switch from one branch to another branch.

git merge: merges specified branch history into the current branch.

git fetch: fetch all remote branches.

git log: check all git commits and logs.

git cherry-pick: apply changes of a specific commit to another branch.

git stash: allows users to save unfinished work changes that have been made to your working directory but don’t want to commit immediately.

git rebase: integrate changes from one branch to another branch.

More from this blog

Achyut Das

34 posts