Terminal Command for beginiers

iamVariable
3 min readNov 24, 2023

Terminal is the most powerful machanism in your machines.

Navigation to different directories

cd direcotryA/

Here CD refers to Change Directory. If you wanna go to directoryA from your current directory, it helps you.

ls 
or
ls -a (which -a will show even the hidden files from the directory)

This above command refers to List of files inside the current directory. If you want know the files you just give this command

pwd

This command refers to Print Working Directory. If you run this command this will let you know where you are currently.

pushd

This pushd states that Push Directory, which helps to navigate to inner directory and it will have the stack where you are coming from.

popd

This popd states that Pop Directory, which helps you to come back to the previous directory. Lets say, if you move from desktop to dirA/dirB/dirC. I mean pushd dirA/dirB/dirC. You are currently in dirC. If you wanna back to desktop just pass the popd command.

Git Commands

Lets learn something about Git. It’s a distributed version control system that is widely used for tracking changes in source code during software development. It was created by Linus Torvalds in 2005 for managing the development of the Linux kernel, but it has since become the standard for version control in many other projects.

Don’t waste time, Let’s jump into the commands..

git init: Initializes a new Git repository, creating a new .git subfolder in the current working directory.

git init

git clone: Creates a copy of a remote repository on your local machine.

git clone

git add: Adds changes in the working directory to the staging area.

git add <file name with path> (or) . (. meaning to say adding all files)

git commit: Records changes in the staging area, creating a new commit.

git commit -m"Add messages"

git status: Shows the status of changes as untracked, modified, or staged. It will show you the list of files that had different.

git status

git push: Uploads local repository content to a remote repository.

git push -u origin <branch_name>

git pull: Fetches changes from a remote repository and merges them into the current branch.

git pull -u origin <branch_name>

git fetch: Fetches changes from a remote repository but it wont merge them.

git fetch 

git branch: Lists all local branches and highlights the currently active one will show in different color by mentioning * in prefix

git branch 

git branch To create a new branch:

git branch <branch_name>

git switch: Switches to the specified branch or commit.

git switch <branch_name>

git branch —b To create and switch to a new branch:

git branch -b <branch_name>

git merge: Merges changes from one branch into current branch.

git merge <branch_name>

git add: adding local changes to git

git add path/to/the/file
(or)
git add . <which . meaning to add all the local changes to git>

git commit : Added files are ready to commit to Git

git commit -m "Message"

git push : Which helps to push your changes to remote repository.

git push -u origin <branch-name>

Still more commands are there to play around. Lets see in another lecture..

Happie Coding:)

--

--

iamVariable

Experienced Mobile Application developer and in full software development lifecycle, including analysis, design, development, deployment.