Git introduction and command cheat sheet

Git is a version control system, basically used for management of source code during software development. Licensed under GNU.

Git is easy to learn and use. I will walk you through few basic and most frequently used git commands during software development.


Basic git command cheat sheet

Check git version command: "git --version"
Initialise git in your local command: "git init"
Clone a git repo: "git clone <url>"
switching git branch: "git checkout <branch name>"
fetch and merge changes into current branch: "git pull"
check your local modifications: "git diff"

Add your local changes: "git add <file name>"
Add all files "git add ."
Commit git changes after add: "git commit -m"<commit message>" "
Push your local commit to remote: "git push origin <branchName>"
Git Clean untracked files: "git clean"
Git Clean untracked files force "git clean -f"
Stash git changes: "git stash"
Apply latest stashed changes: "git stash apply"
See all git stashed list: "git stash list"
Apply specific git stash: "git stash apply stash@{0}"
stash index can be found from stash list
git discard all local changes: "git checkout ."
git discard a specific file or folder change: "git checkout <filename|path>"
git remove or delete local branch: "git branch -d"
git undo local commit: "git reset --hard HEAD"


Windows Simple Commands

To find out IP address in windows using below command:


To find IP address, mac and LAN setting info using below command:



How to find out mac address in windows

How to find out Address Resolution Protocol

2. How to find out BCDBOOT


4.How to find out HOSTNAME in windows machine

5.How to find out MD HELLo

6. To communicate two machines or Network communication in Windows machine using “ping”

To check Query process in windows

REGEDIT in simple command for windows

SET command in Windows

To check system information for windows users, for Host name, version, etc info using SYSTEMINFO command

To find out version of windows

For network statistical to find network info of windows

Linux Basic and Advanced Commands for Beginners

Ubuntu is an open source operating system for all users. Here Ubuntu/Linux basic and advanced commands for beginners and admins.

Ubuntu/Linux commands for Ubuntu users:


Below commands related to the system by using terminal

uname -a — Display LINUX system information

uname -r — Display kernel release information

uptime — Show how long the system has been running + load

hostname — Show system hostname

hostname -i — Display the IP address of the host

last reboot — Show system reboot history

date — Show the current date and time

cal — Show this month calendar

whoami — Who you are logged in as        


Is -al –Display all information about files/ directories

pwd –Show the path of the current directory

mkdir directory-name –Create a directory

cp  file l   file 2 –Copy file l to file 2

cp -r dir 1 dir 2 –Copy dir 1 to dir 2, create dir 2 if it doesn’t exist

mv file l file 2 –Rename source to dest / move source to directory

touch file –Create or update file

cat > file –Place standard input into file

more file –Output contents of the file

head file –Output first 10 lines of file

tail file –Output last 10 lines of file

wc –print the number of bytes, words, and lines in files

xargs –Execute command lines from standard input.

rm file-name –Delete file

rm -r directory-name –Delete directory recursively

rm -f file-name –Forcefully remove file

rm -rf directory-name –Forcefully remove directory recursively


ps –Display your currently active processes

pmap –Memory map of the process

top –Display all running processes

bg –Resumes suspended jobs without bringing them to the foreground

fg –Brings the most recent job to foreground
fg n –Brings job n to the foreground

kill pid –Kill process with     mentioned pid id
kill all proc –Kill all processes named proc
pkill process-name –Send signal to a process with its name

ps aux | grep ‘telnet’ –Find all process id related to telnet process



ifconfig — Display ip address in ubuntu

ip addr show –Display all network interfaces and ip address 

ip address add dev eth0 –Set IP address

mii-tool eth0 –Linux tool to show ethernet status
ping host –Send echo request to test

dig domain –Get DNS information for the domain

dig -x host –Reverse lookup host

host –Lookup DNS ip address for the name

hostname -i –Lookup local ip address

wget file –Download file

netstat -tupl –Listing all active listening     ports.



rpm -i pkg name.rpm –Install rpm based package
rpm -e pkg name –Remove package



dmesg –Detected hardware and boot messages

cat /proc/cpuinfo –CPU model

cat /proc/meminfo –Hardware memory

cat /proc/interrupts –List the number of inturrepts per CPU per I/O device

lshw –Display information on hardware configuration of the system

lsblk –Displays block device-related information in LINUX

free -m –Used and free memory(-m for MB)

lspci -tv –Show PCI devices

lsusb -tv –Show USB divices

dmidecode –Show hardware info from the BIOS



id –Show the active user id with login and group

last –Show last logins on the system

who –Show who is logged on the system

usermod –Modify user information.

groupadd admin –Add group “admin”
useradd -c “Sam Tomshi” –g admin -m sam #Create user “sam”
userdel sam –Delete user sam
adduser sam –Add user “sam”



chmod octal file-name –Change the permissions of file to octal
chmod 777 /data/test.c –Set rwx permission for owner,group,world
chmod 755 /data/test.c –Set rwx permission for owner,rx for group and world
chown owner-user file –Change owner of the file
chown owner-user:owner-group file-name –Change owner and group owner of the file
chown owner-user:owner-group directory –Change owner and group owner of the directory.



tar cf home.tar home –Create tar named home.tar containg home
tar xf file.tar –Extract the files from file.tar
tar czf file.tar.gz files –Create a tar with gzip compression
gzip file –Compress file and renames it to file.gz



df -h –Show free space on mounted filesystems
df -i –Show free inodes on mounted filesystems
fdisc -l –Show discs partitions sizes and types
du -ah –Display disc usage in human readable form
du -sh –Display total dosc usage on the current directory
findmnt –Displays target mount point for all filesystem
mount device-path mount-point –Mount a device


cd .. –To go up one level of the directory tree
cd –goto $HOME directory
cd/test –Change to/Test directory