SlideShare a Scribd company logo
1 of 24
Download to read offline
Basics of
Linux Commands,
Git and GitHub
- Devang Garach
Teacher’s Day 2020
M.C.A. Department
● History of Linux? (Fast Forward)
● Brief overview of Linux OS files/ folders system
● Basics Commands on Linux (Useful in daily routine)
● What is Git? How to use?
● Difference between Git and GitHub
● How can we host HTML based website,
and to get github.io domain, Free of cost ₹0/-
Agenda
● It is one of the flaour of UNIX
● Linus Torvalds modified UNIX and called called it as LINUX
(LINUS+UNIX=LINUX)
● Linus together with Richard stallman made LINUX free
○ And Agencies such as Free Software Foundation created
GNU project to provide free software
● Linux is open source operating system
● GNU/Linux flavours
○ Red Hat, Caldera, Debian, SuSE and Mandrake.
● It also has GUI Environment like GNOME and KDE (K Desktop
Environment)
● Technically, Linux is the Kernel, which is derived from UNIX
History of Linux
● Linux has Two components : Kernel and Shell.
○ Linux Kernel is the the program which runs in background
and convert all your commands to machine dependent
signals. It is the core of the OS.
○ Shell is the interface between the user and the kernel.
● Command Line Interface : bash, sh, dash, zsh etc.
● Graphical User Interface : GNOME, KDE, Unity, Xfce,
Pantheon, etc.
History of Linux (Continue...)
What is Linux Kernel?
● Graphical Environment - KDE/ GNOME/IceWM, others ...
● Browser - Mozilla
● E-mail - Kmail / Evolution
● Instant Messenger - Gaim
● FTP Client - gftp
● Multimedia - XMMS/ Xine / Cdparania / Cdrecord
● Image Browser - GQView
● Image Editor - GIMP
● Security - iptables / ipchains
● Office Suite - OpenOffice / StarOffice / KOffice
● File Browser - Konqueror
● Editors - Joe, VI, Kwrite, Gedit, OpenOffice Writer
● Games - Quake, Doom, SimCity, many others…
● Database - Postgres
● Server - Apache Server
History of Linux (Continue...)
Linux Applications (supported in earlier stage)
Brief Overview of Linux File System
Brief Overview of Linux File System (Continue)
/ (root) - The root contains, user's home directory
/bin/ - This directory where many commonly used executable UNIX commands
resides here
/boot/ - This directory holds files used in booting the operating system
/dev/ - It contains device specific files
/etc/ - It contains system configuration files
/home/ - It contains user directories and files
/lib/ - It contains all library files
/media/ - Directory contains subdirectories where removable media devices inserted
into the computer are mounted.
/mnt/ - It contains device files related to system related to mounted devices
/opt/ - In directory where to install unbundled packages, each in its own subdirectory
/root/ - The root system administrator users directory
/sbin/ - Commands for system administrator
/srv/ - contains site-specific data which is served by this system
/tmp/ - Storage for temporary files which are periodically removed from the file
System
/usr/ - It have several subdirectories that contain additional UNIX commands and
data files
/usr/bin/ - that contains most of the executable files
/usr/include - Contains standard header files used by c program
/usr/lib/ - Contains object files and libraries
/usr/sbin/ - It is used to store many application programs
/usr/man/ - Manuals pages stored here.
/var/ - Variable part of the file system
. Contains print jobs and outgoing and incoming mail
/var/cache/ - It is intended for cached data from applications. Such data is locally
generated as a result of time-consuming I/O or calculation
/var/log/ - This directory contains logs from the OS itself, services, and various
applications running on the system.
/var/spool/ - Contains data which is awaiting some kind of later processing
/var/tmp/ - This directory is for programs that require temporary files or
directories that are preserved between system reboots
Brief Overview of Linux File System (Continue)
Basics Commands
apt
apt-get
sudo
su
man
clear
who
whoami
uname
ls
chmod
ifconfig
free
lshw
lspci
touch
cat
ps
kill
passwd
zip
unzip
gzip
gunzip
mv
cp
rm
rmdir
mkdir
cd
chown
echo $HOME
printf
Basics Commands Theory
Advanced Package Tool, or ‘apt’, is a free-software user interface that works with core
libraries to handle the installation and removal of software on Debian, Ubuntu, and
related Linux distributions.
apt
‘sudo’ command allows you to run programs with the security privileges of another user
(by default, as the superuser). It prompts you for your personal password and confirms
your request to execute a command by checking a file, called sudoers , which the system
administrator configures.
sudo
‘su’ is used to switch from one account to another. User will be prompted for the
password of the user switching to.
su
‘man’ command in Linux is used to display the user manual of any command that we can
run on the terminal. It provides a detailed view of the command which includes NAME,
SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS, etc.
man
Basics Commands Theory (Continue...)
‘clear’ command, clears the terminal screen
clear
‘who’ command lets you display the users that are currently logged into your Unix
computer system, with date and time.
who
‘whoami’ command lets you display the users that are currently logged into the system.
whoami
‘uname’ command reports basic information about a computer's software and
hardware. When used without any options, uname reports the name, but not the
version number, of the kernel (i.e., the core of the operating system).
uname
‘ls’ command is used for listing the contents of a directory or directories given to it via
standard input. It writes results to standard output. The ‘ls’ command supports showing
a variety of information about files, sorting on a range of options and recursive listing.
ls -l command which lists the files in the working directory in long format.
ls
Basics Commands Theory (Continue...)
‘chmod’ is the command and system call which is used to change the access permissions
of file system objects
In Linux, each file is associated with an owner and a group and assigned with permission
access rights for three different classes of users:
-----------------------------------
The file ‘owner’. -u |
The ‘group’ members. -g |
Others (everybody else). -o |
-----------------------------------
ls -l filename.txt
chmod
r : Permission to read the file.
w : Permission to write (or delete) the file.
x : Permission to execute the file, or, in the case
of a directory, search it.
- : No permission
Basics Commands Theory (Continue...)
u - The file owner.
g - The users who are members of the group.
o - All other users.
a - All users, identical to ugo
chmod
- Removes the specified permissions.
+ Adds specified permissions.
= Changes the current permissions to the specified
permissions. If no permissions are specified after
the = symbol, all permissions from the specified
user class are removed.
Basics Commands Theory (Continue...)
Permission number:
File permission can be represented in a numeric or symbolic format. In this article, we’ll
focus on the numeric format.
The permission number can consist of three or four digits, ranging from 0 to 7.
When 3 digits number is used, the first digit represents the permissions of the file’s
owner, the second one the file’s group and the last one all other users.
The write, read, and execute permissions have the following number value:
r (read) = 4
w (write) = 2
x (execute) = 1
no permissions = 0
The permissions digit of a specific user class is the sum of the values of the permissions
for that class.
chmod (Method 2)
Basics Commands Theory (Continue...)
Each digit of the permissions number may be a sum of 4, 2, 1 and 0:
0 (0+0+0) – No permission.
1 (0+0+1) – Only execute permission.
2 (0+2+0) – Only write permission.
3 (0+2+1) – Write and execute permissions.
4 (4+0+0) – Only read permission.
5 (4+0+1) – Read and execute permission.
6 (4+2+0) – Read and write permissions.
7 (4+2+1) – Read, write, and execute permission.
For example, if the permission number is set to 750 it means that the file’s owner has
read, write and execute permission, file’s group has read and execute permissions, and
other users have no permissions:
Owner: rwx = 4+2+1=7
Group: r-x = 4+0+1=5
Others: --- = 0+0+0=0
chmod (Method 2)
Basics Commands Theory (Continue...)
‘ifconfig’ stands for "Interface Configuration" . It is a utility for Linux machines to
configure,assign,add,delete,control and query network interface in Unix/Linux
machine. Common Linux users uses ‘ifconfig’ command to assign ip address and
netmask to an interface or to disable or enable a given interface
ifconfig
‘free’ command displays how much of your computer's memory is in use and how much
is still available for programs to use
free
‘lshw’ (list hardware) which is used to generate the detailed information of the system's
hardware configuration from various files in the /proc directory.
lshw
‘lspci’ is a command on Unix-like operating systems that prints ("lists") detailed
information about all PCI buses and devices in the system
lspci
‘touch’ command is used to create empty files & also changes the timestamps of existing files
touch
Basics Commands Theory (Continue...)
‘cat’ command allows us to create single or multiple files, view contain of file,
concatenate files and redirect output in terminal or files.
cat
‘ps’ (Process Status), is a command line utility that is used to display or view information
related to the processes running in a Linux system.
ps
‘kill’ (list hardware) which is used to generate the detailed information of the system's
hardware configuration from various files in the /proc directory.
kill
‘passwd’ command is used to change the password of system users. If the passwd
command is executed by non-root user then it will ask for the current password and
then set the new password of a user who invoked the command. When this command is
executed by super user or root then it can reset the password for any user including root
without knowing the current password.
passwd
Basics Commands Theory (Continue...)
‘cat’ command allows us to create single or multiple files, view contain of file,
concatenate files and redirect output in terminal or files.
zip
‘unzip’ command extracts all files from the specified ZIP archive to the current directory
unzip
‘gzip’ is one of the most popular compression algorithms that allow you to reduce the
size of a file.
gzip
‘gunzip’ is a command-line tool for decompressing Gzip files.
gunzip
‘mv’ to move files / folders
mv
‘cp’ to copy files / folders
cp
‘rm’ to remove files
rm
‘rmdir’ empty directory
rmdir
‘mkdir’ to make directory
mkdir
‘cd’ to change directory
cd
● Version Control System(VCS) for tracking changes in computer files,
developed by Linus Torvald in 2005
● Distributed version control/decentralized version control system
● Coordinates work between multiple developers
● who made, what changes and when?
● Revert back at any time
● Local & Remote Repository
Concept of Git
● keep track of code history
● takes "snapshots" of your files
● you decides when to take a snapshot by making a "commit"
● you can visit any snapshot at any time
● you can stage files before commiting
What is Git?
● git init // initalilze local git repository
● git add <file> // add files to index
● git status // check status of working tree
● git commit // commit changes in index
● git push // push to remote repository
● git pull // pull latest from remote repository
● git clone // clone repository into new directory
Basics Commands in git?
● Linux (Debian) OS
sudo apt-get install git
● Linux (Fedora) OS
sudo yum install git
● Mac OS
http://git-scm.com/download/mac
● Windows OS
http://git-scm.com/download/win
How to Install Git?
● git --version
● git init
● git config --global user.name 'Devang Garach'
● git config --global user.email 'devanggarach@gmail.com'
● git add index.html | git add . | git add *.html | git add -A
● git status
● git rm --cached index.html
● git branch branch_name
● git checkout branch_name
● git commit | git commit -m ‘message’
● touch .gitignore
● git merge branch_name
● git remote add origin https://from_github_address
● git push -u origin master
● git clone https://from_github_address
● git pull | git log | git rebase branch_name | git revert 8digitcode_from_log
Git commands
Difference Between Git & GitHub
Repository
Repository
Working Copy Working Copy
Working Copy
Repository
Repository
Distributed Version Control System
Server
push
pull
push
pull
commit
update
commit
update
commit
update
push
pull
Thank you

More Related Content

What's hot

Basic Linux Security
Basic Linux SecurityBasic Linux Security
Basic Linux Securitypankaj009
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redisTanu Siwag
 
WordPress + NGINX Best Practices with EasyEngine
WordPress + NGINX Best Practices with EasyEngineWordPress + NGINX Best Practices with EasyEngine
WordPress + NGINX Best Practices with EasyEngineNGINX, Inc.
 
MySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELKMySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELKYoungHeon (Roy) Kim
 
Salty OPS – Saltstack Introduction
Salty OPS – Saltstack IntroductionSalty OPS – Saltstack Introduction
Salty OPS – Saltstack IntroductionWalter Liu
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINXNGINX, Inc.
 
CSS Pseudo Classes
CSS Pseudo ClassesCSS Pseudo Classes
CSS Pseudo Classesfrontendne
 
Redis overview for Software Architecture Forum
Redis overview for Software Architecture ForumRedis overview for Software Architecture Forum
Redis overview for Software Architecture ForumChristopher Spring
 
jq: JSON - Like a Boss
jq: JSON - Like a Bossjq: JSON - Like a Boss
jq: JSON - Like a BossBob Tiernay
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in LinuxKnoldus Inc.
 
Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with RedisGeorge Platon
 

What's hot (20)

User management
User managementUser management
User management
 
Basic Linux Security
Basic Linux SecurityBasic Linux Security
Basic Linux Security
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
 
redis basics
redis basicsredis basics
redis basics
 
WordPress + NGINX Best Practices with EasyEngine
WordPress + NGINX Best Practices with EasyEngineWordPress + NGINX Best Practices with EasyEngine
WordPress + NGINX Best Practices with EasyEngine
 
MySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELKMySQL Slow Query log Monitoring using Beats & ELK
MySQL Slow Query log Monitoring using Beats & ELK
 
Salty OPS – Saltstack Introduction
Salty OPS – Saltstack IntroductionSalty OPS – Saltstack Introduction
Salty OPS – Saltstack Introduction
 
XSLT
XSLTXSLT
XSLT
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
CSS Pseudo Classes
CSS Pseudo ClassesCSS Pseudo Classes
CSS Pseudo Classes
 
Nginx dhruba mandal
Nginx dhruba mandalNginx dhruba mandal
Nginx dhruba mandal
 
Redis overview for Software Architecture Forum
Redis overview for Software Architecture ForumRedis overview for Software Architecture Forum
Redis overview for Software Architecture Forum
 
jq: JSON - Like a Boss
jq: JSON - Like a Bossjq: JSON - Like a Boss
jq: JSON - Like a Boss
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in Linux
 
Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
 
Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with Redis
 
LDAP
LDAPLDAP
LDAP
 
XSLT y XPATH
XSLT y XPATHXSLT y XPATH
XSLT y XPATH
 
Nginx Essential
Nginx EssentialNginx Essential
Nginx Essential
 

Similar to Basics of Linux Commands, Git and Github

Similar to Basics of Linux Commands, Git and Github (20)

Unix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basiUnix_Introduction_BCA.pptx the very basi
Unix_Introduction_BCA.pptx the very basi
 
I Am Linux-Introductory Module on Linux
I Am Linux-Introductory Module on LinuxI Am Linux-Introductory Module on Linux
I Am Linux-Introductory Module on Linux
 
system management -shell programming by gaurav raikar
system management -shell programming by gaurav raikarsystem management -shell programming by gaurav raikar
system management -shell programming by gaurav raikar
 
system management -shell programming by Gaurav raikar
system management -shell programming by Gaurav raikarsystem management -shell programming by Gaurav raikar
system management -shell programming by Gaurav raikar
 
Chapter 2 Introduction to Unix Concepts
Chapter 2 Introduction to Unix ConceptsChapter 2 Introduction to Unix Concepts
Chapter 2 Introduction to Unix Concepts
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Lesson 1 Linux System Fundamentals
Lesson 1 Linux System Fundamentals  Lesson 1 Linux System Fundamentals
Lesson 1 Linux System Fundamentals
 
Linux
LinuxLinux
Linux
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Nithi
NithiNithi
Nithi
 
Ch1 linux basics
Ch1 linux basicsCh1 linux basics
Ch1 linux basics
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
UNIT II-Programming in Linux
UNIT II-Programming in LinuxUNIT II-Programming in Linux
UNIT II-Programming in Linux
 
Linux
LinuxLinux
Linux
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
Basic orientation to Linux
Basic orientation to LinuxBasic orientation to Linux
Basic orientation to Linux
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Linux basic
Linux basicLinux basic
Linux basic
 
Linux
LinuxLinux
Linux
 

More from Devang Garach

AWS Concepts - Internship Presentation - week 10
AWS Concepts - Internship Presentation - week 10AWS Concepts - Internship Presentation - week 10
AWS Concepts - Internship Presentation - week 10Devang Garach
 
A glimpse inside of SEO - Internship Presentation - week 9
A glimpse inside of SEO - Internship Presentation - week 9A glimpse inside of SEO - Internship Presentation - week 9
A glimpse inside of SEO - Internship Presentation - week 9Devang Garach
 
Machine Learning and its types - Internship Presentation - week 8
Machine Learning and its types - Internship Presentation - week 8Machine Learning and its types - Internship Presentation - week 8
Machine Learning and its types - Internship Presentation - week 8Devang Garach
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Devang Garach
 
Advanced JavaScript - Internship Presentation - Week6
Advanced JavaScript - Internship Presentation - Week6Advanced JavaScript - Internship Presentation - Week6
Advanced JavaScript - Internship Presentation - Week6Devang Garach
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Devang Garach
 
Brief Introduction on JavaScript - Internship Presentation - Week4
Brief Introduction on JavaScript - Internship Presentation - Week4Brief Introduction on JavaScript - Internship Presentation - Week4
Brief Introduction on JavaScript - Internship Presentation - Week4Devang Garach
 
Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3Devang Garach
 
M.C.A. Internship Project Presentation - Devang Garach [191823011]
M.C.A. Internship Project Presentation - Devang Garach [191823011]M.C.A. Internship Project Presentation - Devang Garach [191823011]
M.C.A. Internship Project Presentation - Devang Garach [191823011]Devang Garach
 

More from Devang Garach (9)

AWS Concepts - Internship Presentation - week 10
AWS Concepts - Internship Presentation - week 10AWS Concepts - Internship Presentation - week 10
AWS Concepts - Internship Presentation - week 10
 
A glimpse inside of SEO - Internship Presentation - week 9
A glimpse inside of SEO - Internship Presentation - week 9A glimpse inside of SEO - Internship Presentation - week 9
A glimpse inside of SEO - Internship Presentation - week 9
 
Machine Learning and its types - Internship Presentation - week 8
Machine Learning and its types - Internship Presentation - week 8Machine Learning and its types - Internship Presentation - week 8
Machine Learning and its types - Internship Presentation - week 8
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7
 
Advanced JavaScript - Internship Presentation - Week6
Advanced JavaScript - Internship Presentation - Week6Advanced JavaScript - Internship Presentation - Week6
Advanced JavaScript - Internship Presentation - Week6
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5
 
Brief Introduction on JavaScript - Internship Presentation - Week4
Brief Introduction on JavaScript - Internship Presentation - Week4Brief Introduction on JavaScript - Internship Presentation - Week4
Brief Introduction on JavaScript - Internship Presentation - Week4
 
Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3Intro to HTML, CSS & JS - Internship Presentation Week-3
Intro to HTML, CSS & JS - Internship Presentation Week-3
 
M.C.A. Internship Project Presentation - Devang Garach [191823011]
M.C.A. Internship Project Presentation - Devang Garach [191823011]M.C.A. Internship Project Presentation - Devang Garach [191823011]
M.C.A. Internship Project Presentation - Devang Garach [191823011]
 

Recently uploaded

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 

Recently uploaded (20)

COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

Basics of Linux Commands, Git and Github

  • 1. Basics of Linux Commands, Git and GitHub - Devang Garach Teacher’s Day 2020 M.C.A. Department
  • 2. ● History of Linux? (Fast Forward) ● Brief overview of Linux OS files/ folders system ● Basics Commands on Linux (Useful in daily routine) ● What is Git? How to use? ● Difference between Git and GitHub ● How can we host HTML based website, and to get github.io domain, Free of cost ₹0/- Agenda
  • 3. ● It is one of the flaour of UNIX ● Linus Torvalds modified UNIX and called called it as LINUX (LINUS+UNIX=LINUX) ● Linus together with Richard stallman made LINUX free ○ And Agencies such as Free Software Foundation created GNU project to provide free software ● Linux is open source operating system ● GNU/Linux flavours ○ Red Hat, Caldera, Debian, SuSE and Mandrake. ● It also has GUI Environment like GNOME and KDE (K Desktop Environment) ● Technically, Linux is the Kernel, which is derived from UNIX History of Linux
  • 4. ● Linux has Two components : Kernel and Shell. ○ Linux Kernel is the the program which runs in background and convert all your commands to machine dependent signals. It is the core of the OS. ○ Shell is the interface between the user and the kernel. ● Command Line Interface : bash, sh, dash, zsh etc. ● Graphical User Interface : GNOME, KDE, Unity, Xfce, Pantheon, etc. History of Linux (Continue...) What is Linux Kernel?
  • 5. ● Graphical Environment - KDE/ GNOME/IceWM, others ... ● Browser - Mozilla ● E-mail - Kmail / Evolution ● Instant Messenger - Gaim ● FTP Client - gftp ● Multimedia - XMMS/ Xine / Cdparania / Cdrecord ● Image Browser - GQView ● Image Editor - GIMP ● Security - iptables / ipchains ● Office Suite - OpenOffice / StarOffice / KOffice ● File Browser - Konqueror ● Editors - Joe, VI, Kwrite, Gedit, OpenOffice Writer ● Games - Quake, Doom, SimCity, many others… ● Database - Postgres ● Server - Apache Server History of Linux (Continue...) Linux Applications (supported in earlier stage)
  • 6. Brief Overview of Linux File System
  • 7. Brief Overview of Linux File System (Continue) / (root) - The root contains, user's home directory /bin/ - This directory where many commonly used executable UNIX commands resides here /boot/ - This directory holds files used in booting the operating system /dev/ - It contains device specific files /etc/ - It contains system configuration files /home/ - It contains user directories and files /lib/ - It contains all library files /media/ - Directory contains subdirectories where removable media devices inserted into the computer are mounted. /mnt/ - It contains device files related to system related to mounted devices /opt/ - In directory where to install unbundled packages, each in its own subdirectory /root/ - The root system administrator users directory /sbin/ - Commands for system administrator /srv/ - contains site-specific data which is served by this system /tmp/ - Storage for temporary files which are periodically removed from the file System
  • 8. /usr/ - It have several subdirectories that contain additional UNIX commands and data files /usr/bin/ - that contains most of the executable files /usr/include - Contains standard header files used by c program /usr/lib/ - Contains object files and libraries /usr/sbin/ - It is used to store many application programs /usr/man/ - Manuals pages stored here. /var/ - Variable part of the file system . Contains print jobs and outgoing and incoming mail /var/cache/ - It is intended for cached data from applications. Such data is locally generated as a result of time-consuming I/O or calculation /var/log/ - This directory contains logs from the OS itself, services, and various applications running on the system. /var/spool/ - Contains data which is awaiting some kind of later processing /var/tmp/ - This directory is for programs that require temporary files or directories that are preserved between system reboots Brief Overview of Linux File System (Continue)
  • 10. Basics Commands Theory Advanced Package Tool, or ‘apt’, is a free-software user interface that works with core libraries to handle the installation and removal of software on Debian, Ubuntu, and related Linux distributions. apt ‘sudo’ command allows you to run programs with the security privileges of another user (by default, as the superuser). It prompts you for your personal password and confirms your request to execute a command by checking a file, called sudoers , which the system administrator configures. sudo ‘su’ is used to switch from one account to another. User will be prompted for the password of the user switching to. su ‘man’ command in Linux is used to display the user manual of any command that we can run on the terminal. It provides a detailed view of the command which includes NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS, etc. man
  • 11. Basics Commands Theory (Continue...) ‘clear’ command, clears the terminal screen clear ‘who’ command lets you display the users that are currently logged into your Unix computer system, with date and time. who ‘whoami’ command lets you display the users that are currently logged into the system. whoami ‘uname’ command reports basic information about a computer's software and hardware. When used without any options, uname reports the name, but not the version number, of the kernel (i.e., the core of the operating system). uname ‘ls’ command is used for listing the contents of a directory or directories given to it via standard input. It writes results to standard output. The ‘ls’ command supports showing a variety of information about files, sorting on a range of options and recursive listing. ls -l command which lists the files in the working directory in long format. ls
  • 12. Basics Commands Theory (Continue...) ‘chmod’ is the command and system call which is used to change the access permissions of file system objects In Linux, each file is associated with an owner and a group and assigned with permission access rights for three different classes of users: ----------------------------------- The file ‘owner’. -u | The ‘group’ members. -g | Others (everybody else). -o | ----------------------------------- ls -l filename.txt chmod r : Permission to read the file. w : Permission to write (or delete) the file. x : Permission to execute the file, or, in the case of a directory, search it. - : No permission
  • 13. Basics Commands Theory (Continue...) u - The file owner. g - The users who are members of the group. o - All other users. a - All users, identical to ugo chmod - Removes the specified permissions. + Adds specified permissions. = Changes the current permissions to the specified permissions. If no permissions are specified after the = symbol, all permissions from the specified user class are removed.
  • 14. Basics Commands Theory (Continue...) Permission number: File permission can be represented in a numeric or symbolic format. In this article, we’ll focus on the numeric format. The permission number can consist of three or four digits, ranging from 0 to 7. When 3 digits number is used, the first digit represents the permissions of the file’s owner, the second one the file’s group and the last one all other users. The write, read, and execute permissions have the following number value: r (read) = 4 w (write) = 2 x (execute) = 1 no permissions = 0 The permissions digit of a specific user class is the sum of the values of the permissions for that class. chmod (Method 2)
  • 15. Basics Commands Theory (Continue...) Each digit of the permissions number may be a sum of 4, 2, 1 and 0: 0 (0+0+0) – No permission. 1 (0+0+1) – Only execute permission. 2 (0+2+0) – Only write permission. 3 (0+2+1) – Write and execute permissions. 4 (4+0+0) – Only read permission. 5 (4+0+1) – Read and execute permission. 6 (4+2+0) – Read and write permissions. 7 (4+2+1) – Read, write, and execute permission. For example, if the permission number is set to 750 it means that the file’s owner has read, write and execute permission, file’s group has read and execute permissions, and other users have no permissions: Owner: rwx = 4+2+1=7 Group: r-x = 4+0+1=5 Others: --- = 0+0+0=0 chmod (Method 2)
  • 16. Basics Commands Theory (Continue...) ‘ifconfig’ stands for "Interface Configuration" . It is a utility for Linux machines to configure,assign,add,delete,control and query network interface in Unix/Linux machine. Common Linux users uses ‘ifconfig’ command to assign ip address and netmask to an interface or to disable or enable a given interface ifconfig ‘free’ command displays how much of your computer's memory is in use and how much is still available for programs to use free ‘lshw’ (list hardware) which is used to generate the detailed information of the system's hardware configuration from various files in the /proc directory. lshw ‘lspci’ is a command on Unix-like operating systems that prints ("lists") detailed information about all PCI buses and devices in the system lspci ‘touch’ command is used to create empty files & also changes the timestamps of existing files touch
  • 17. Basics Commands Theory (Continue...) ‘cat’ command allows us to create single or multiple files, view contain of file, concatenate files and redirect output in terminal or files. cat ‘ps’ (Process Status), is a command line utility that is used to display or view information related to the processes running in a Linux system. ps ‘kill’ (list hardware) which is used to generate the detailed information of the system's hardware configuration from various files in the /proc directory. kill ‘passwd’ command is used to change the password of system users. If the passwd command is executed by non-root user then it will ask for the current password and then set the new password of a user who invoked the command. When this command is executed by super user or root then it can reset the password for any user including root without knowing the current password. passwd
  • 18. Basics Commands Theory (Continue...) ‘cat’ command allows us to create single or multiple files, view contain of file, concatenate files and redirect output in terminal or files. zip ‘unzip’ command extracts all files from the specified ZIP archive to the current directory unzip ‘gzip’ is one of the most popular compression algorithms that allow you to reduce the size of a file. gzip ‘gunzip’ is a command-line tool for decompressing Gzip files. gunzip ‘mv’ to move files / folders mv ‘cp’ to copy files / folders cp ‘rm’ to remove files rm ‘rmdir’ empty directory rmdir ‘mkdir’ to make directory mkdir ‘cd’ to change directory cd
  • 19. ● Version Control System(VCS) for tracking changes in computer files, developed by Linus Torvald in 2005 ● Distributed version control/decentralized version control system ● Coordinates work between multiple developers ● who made, what changes and when? ● Revert back at any time ● Local & Remote Repository Concept of Git ● keep track of code history ● takes "snapshots" of your files ● you decides when to take a snapshot by making a "commit" ● you can visit any snapshot at any time ● you can stage files before commiting What is Git?
  • 20. ● git init // initalilze local git repository ● git add <file> // add files to index ● git status // check status of working tree ● git commit // commit changes in index ● git push // push to remote repository ● git pull // pull latest from remote repository ● git clone // clone repository into new directory Basics Commands in git?
  • 21. ● Linux (Debian) OS sudo apt-get install git ● Linux (Fedora) OS sudo yum install git ● Mac OS http://git-scm.com/download/mac ● Windows OS http://git-scm.com/download/win How to Install Git?
  • 22. ● git --version ● git init ● git config --global user.name 'Devang Garach' ● git config --global user.email 'devanggarach@gmail.com' ● git add index.html | git add . | git add *.html | git add -A ● git status ● git rm --cached index.html ● git branch branch_name ● git checkout branch_name ● git commit | git commit -m ‘message’ ● touch .gitignore ● git merge branch_name ● git remote add origin https://from_github_address ● git push -u origin master ● git clone https://from_github_address ● git pull | git log | git rebase branch_name | git revert 8digitcode_from_log Git commands
  • 23. Difference Between Git & GitHub Repository Repository Working Copy Working Copy Working Copy Repository Repository Distributed Version Control System Server push pull push pull commit update commit update commit update push pull