SlideShare a Scribd company logo
1 of 14
Linux Basics
Geeta Vinnakota
Outline
• Terms
• Releases
• File System
• Package Management
• Environment Variables
• Processes
• User Management
• Command Enhancements
• Aliases
• Network Management
• Terminal Tips & Misc
1/23/2016 2
Philosophy of Linux
• Linux does not assume anything.
• Lets you install what you need rather than give you a bunch of things
you may not need
• Linux commands and case sensitive
1/23/2016 3
Terms
Term
Kernel Takes care of resource allocation
Shell Accepts command and passes it to kernel
Service Application that runs in the background
1/23/2016 4
Releases
lsb_release -a Prints the release, codename and description
lsb_release -sc Prints the codename
ubuntu-support-status Check status of the release and packages
uname -r prints kernel version
Release Upgrade Steps
sudo apt-get update Step-1
sudo apt-get update update-manager-core Step-2
sudo do-release-upgrade Step-3
1/23/2016 5
File System - Important Directories
/var/run pids for important processes
/var/log log files
/etc/init Configuration Files
/etc/init.d Scripts that respond to start and stop
/etc/hosts DNS
/etc/passwd User database
/etc/ssh SSH configuration
/etc/my.cnf MySQL configuration
/opt/ Optional packages not part of the default installation
~ Home directory
~/.ssh Known Hosts, Authentication Keys
~/.bash_profile Startup File. Defines aliases and configuration
1/23/2016 6
Package Management
apt Advanced Packaging Tool
/etc/apt/sources.list Stores the list of available packages
deb – Repos containing binarires
deb-src – Repos containing source code for packages
sudo apt-get update Checks for new versions
sudo apt-get install nmap To install the package nmap
sudo apt-get remove nmap To remove the package nmap
1/23/2016 7
Environment Variables
env View all environment variables
env | grep PATH
echo $PATH
echo $USER prints current user
1/23/2016 8
Processes
Processes are the core of Linux OS. A process is an instance of a running command.
init First process with id 1. Cannot be killed. Every other process is a child of init
daemon is a background process
htop interactive tool to list and manage processes
Prints CPU & memory utilization of each process
crontab –l list all background scheduled processes
crontab –e edit the crontab
1/23/2016 9
User Management
compgen –u List all users
compgen –g List all groups
sudo su – user2 Switch to user2
sudo Run commands as root user
1/23/2016 10
Command Enhancements
time cmd prints the time taken to execute cmd
cmd1 | cmd2 pass the output of the previous cmd1 to in the input
of the next cmd2
cmd & Execute cmd in the background and return
./cmd bypass an alias
man cmd Manual entry for cmd
whatis cmd Documentation for cmd
screen -x screen sharing between users
1/23/2016 11
Aliases
Aliases help replace 1 string with another while execution. Aliases are usually defined in the configuration file
like .bash_profile
alias ll=“ls—l” Creates an alias
alias ll gets the alias
single quotes variables are not expanded
double quotes variables are expanded
1/23/2016 12
Network Management
netstat -ntlp Network Statistics - List of ports listening
telnet host port Check if the port on the host is listening
iostat Input Output Statistics
host google.com DNS lookup
ping google.com Check is server is active
du disk usage statistics
ifconfig Configure network interface parameters
1/23/2016 13
Terminal Tips & Misc
cmd + R clears terminal
ctrl + R Search through command history
sudo reboot reboot machine & logout
#! /bin/bash Hash bang. First line of a script. Uses bash interpreter
1/23/2016 14

More Related Content

What's hot

Linux presentation
Linux presentationLinux presentation
Linux presentation
Nikhil Jain
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commands
aaj_sarkar06
 

What's hot (20)

Terminal Commands (Linux - ubuntu) (part-1)
Terminal Commands  (Linux - ubuntu) (part-1)Terminal Commands  (Linux - ubuntu) (part-1)
Terminal Commands (Linux - ubuntu) (part-1)
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Module 02 Using Linux Command Shell
Module 02 Using Linux Command ShellModule 02 Using Linux Command Shell
Module 02 Using Linux Command Shell
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Linux commands
Linux commandsLinux commands
Linux commands
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
Linux Getting Started
Linux Getting StartedLinux Getting Started
Linux Getting Started
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Linux Command Suumary
Linux Command SuumaryLinux Command Suumary
Linux Command Suumary
 
Top 10 Random Linux/Ubuntu Commands
Top 10 Random Linux/Ubuntu CommandsTop 10 Random Linux/Ubuntu Commands
Top 10 Random Linux/Ubuntu Commands
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Linux basic
Linux basicLinux basic
Linux basic
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commands
 
Basic commands
Basic commandsBasic commands
Basic commands
 
Linux
Linux Linux
Linux
 

Similar to Linux basics

Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
Chander Pandey
 
Monitoring CPU Utilization on LINUX (Shell Script Project)
Monitoring CPU Utilization on LINUX (Shell Script Project)Monitoring CPU Utilization on LINUX (Shell Script Project)
Monitoring CPU Utilization on LINUX (Shell Script Project)
Dmitry Ponomarenko
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questions
Teja Bheemanapally
 

Similar to Linux basics (20)

Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Linux lecture6
Linux lecture6Linux lecture6
Linux lecture6
 
Monitoring CPU Utilization on LINUX (Shell Script Project)
Monitoring CPU Utilization on LINUX (Shell Script Project)Monitoring CPU Utilization on LINUX (Shell Script Project)
Monitoring CPU Utilization on LINUX (Shell Script Project)
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Linux training
Linux trainingLinux training
Linux training
 
Linux introduction Class 03
Linux introduction Class 03Linux introduction Class 03
Linux introduction Class 03
 
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.comComandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.com
 
Linux
LinuxLinux
Linux
 
Sistemas operacionais 8
Sistemas operacionais 8Sistemas operacionais 8
Sistemas operacionais 8
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Daemons
DaemonsDaemons
Daemons
 
Linux
LinuxLinux
Linux
 
Linux Day2
Linux Day2Linux Day2
Linux Day2
 
Project of deamon process
Project of deamon processProject of deamon process
Project of deamon process
 
Linux introduction (eng)
Linux introduction (eng)Linux introduction (eng)
Linux introduction (eng)
 
Linux or unix interview questions
Linux or unix interview questionsLinux or unix interview questions
Linux or unix interview questions
 
Linux@assignment ppt
Linux@assignment pptLinux@assignment ppt
Linux@assignment ppt
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 

More from Geeta Vinnakota (6)

Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
Nginx
NginxNginx
Nginx
 
Linux files
Linux filesLinux files
Linux files
 
Git
GitGit
Git
 
Rspec
RspecRspec
Rspec
 
Problem solving strategies
Problem solving strategiesProblem solving strategies
Problem solving strategies
 

Recently uploaded

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Linux basics

  • 2. Outline • Terms • Releases • File System • Package Management • Environment Variables • Processes • User Management • Command Enhancements • Aliases • Network Management • Terminal Tips & Misc 1/23/2016 2
  • 3. Philosophy of Linux • Linux does not assume anything. • Lets you install what you need rather than give you a bunch of things you may not need • Linux commands and case sensitive 1/23/2016 3
  • 4. Terms Term Kernel Takes care of resource allocation Shell Accepts command and passes it to kernel Service Application that runs in the background 1/23/2016 4
  • 5. Releases lsb_release -a Prints the release, codename and description lsb_release -sc Prints the codename ubuntu-support-status Check status of the release and packages uname -r prints kernel version Release Upgrade Steps sudo apt-get update Step-1 sudo apt-get update update-manager-core Step-2 sudo do-release-upgrade Step-3 1/23/2016 5
  • 6. File System - Important Directories /var/run pids for important processes /var/log log files /etc/init Configuration Files /etc/init.d Scripts that respond to start and stop /etc/hosts DNS /etc/passwd User database /etc/ssh SSH configuration /etc/my.cnf MySQL configuration /opt/ Optional packages not part of the default installation ~ Home directory ~/.ssh Known Hosts, Authentication Keys ~/.bash_profile Startup File. Defines aliases and configuration 1/23/2016 6
  • 7. Package Management apt Advanced Packaging Tool /etc/apt/sources.list Stores the list of available packages deb – Repos containing binarires deb-src – Repos containing source code for packages sudo apt-get update Checks for new versions sudo apt-get install nmap To install the package nmap sudo apt-get remove nmap To remove the package nmap 1/23/2016 7
  • 8. Environment Variables env View all environment variables env | grep PATH echo $PATH echo $USER prints current user 1/23/2016 8
  • 9. Processes Processes are the core of Linux OS. A process is an instance of a running command. init First process with id 1. Cannot be killed. Every other process is a child of init daemon is a background process htop interactive tool to list and manage processes Prints CPU & memory utilization of each process crontab –l list all background scheduled processes crontab –e edit the crontab 1/23/2016 9
  • 10. User Management compgen –u List all users compgen –g List all groups sudo su – user2 Switch to user2 sudo Run commands as root user 1/23/2016 10
  • 11. Command Enhancements time cmd prints the time taken to execute cmd cmd1 | cmd2 pass the output of the previous cmd1 to in the input of the next cmd2 cmd & Execute cmd in the background and return ./cmd bypass an alias man cmd Manual entry for cmd whatis cmd Documentation for cmd screen -x screen sharing between users 1/23/2016 11
  • 12. Aliases Aliases help replace 1 string with another while execution. Aliases are usually defined in the configuration file like .bash_profile alias ll=“ls—l” Creates an alias alias ll gets the alias single quotes variables are not expanded double quotes variables are expanded 1/23/2016 12
  • 13. Network Management netstat -ntlp Network Statistics - List of ports listening telnet host port Check if the port on the host is listening iostat Input Output Statistics host google.com DNS lookup ping google.com Check is server is active du disk usage statistics ifconfig Configure network interface parameters 1/23/2016 13
  • 14. Terminal Tips & Misc cmd + R clears terminal ctrl + R Search through command history sudo reboot reboot machine & logout #! /bin/bash Hash bang. First line of a script. Uses bash interpreter 1/23/2016 14