SlideShare une entreprise Scribd logo
1  sur  17
Linux Basics
By
SATHISHKUMAR G
(sathishsak111@gmail.com)
Roadmap
 What is Unix?
 What is Linux?
 Which Linux Distribution is better?
 Fish vs. Fishing
 Basic Commands
 Vi and Emacs
 Q&A
 References
What is Unix?
 A multi-task and multi-user Operating System
 Developed in 1969 at AT&T’s Bell Labs by
 Ken Thompson (Unix)
 Dennis Ritchie (C)
 Douglas Mcllroy (Pipes - Do one thing, do it well)
 Some other variants: System V, Solaris, SCO
Unix, SunOS, 4.4BSD, FreeBSD, NetBSD,
OpenBSD, BSDI
What is Linux?
 A clone of Unix
 Developed in 1991 by Linus Torvalds, a Finnish
graduate student
 Inspired by and replacement of Minix
 Linus' Minix became Linux
 Consist of
 Linux Kernel
 GNU (GNU is Not Unix) Software
 Software Package management
 Others
http://www.linuxdevices.com/files/misc/ibm-watchpad.jpg
What is Linux?
 Originally developed for
32-bit x86-based PC
 Ported to other
architectures, eg.
 Alpha, VAX, PowerPC,
IBM S/390, MIPS, IA-64
 PS2, TiVo, cellphones,
watches, Nokia N810,
NDS, routers, NAS, GPS,
…
* See references at the end
for the corresponding websites.
Which Linux Distribution is better?
 > 300 Linux Distributions
 Slackware (one of the oldest, simple and stable distro.)
 Redhat
 RHEL (commercially support)
 Fedora (free)
 CentOS (free RHEL, based in England)
 SuSe ( based in German)
 Gentoo (Source code based)
 Debian (one of the few called GNU/Linux)
 Ubuntu (based in South Africa)
 Knoppix (first LiveCD distro.)
 …
Which Linux Distribution is better?
Source:
http://futurist.se/gldt/
CentOS
Ubuntu
Knoppix
GentooSlackware
Redhat
Debian
Which Linux Distribution is better?
 Ask yourself these questions (from LAH)
 Is it going to be around in 5 yrs?
 Is it giong to stay on top of the latest security
patches?
 Is it going to release updated software promptly?
 If I have problems, will the vendor talk to me?
 Personally, I use Slackware
 But, we will use CentOS (possibly along with
Slackware :)
Fish vs. Fishing
 Manpage
 $ man ls
 $ man 2 mkdir
 $ man man
 $ man -k mkdir
 Manpage sections (LAH
Table 1.2 @ page 12)
 1 User-level cmds and
apps
 /bin/mkdir
 2 System calls
 int mkdir(const char *, …);
 3 Library calls
 int printf(const char *, …);
 4 Device drivers and
network protocols
 /dev/tty
 5 Standard file formats
 /etc/hosts
 6 Games and demos
 /usr/games/fortune
 7 Misc. files and docs
 man 7 locale
 8 System admin. Cmds
 /sbin/reboot
 $ manpath
 $ env | grep MANPATH
 /etc/man.config
Fish vs. Fishing (cont)
 Google
 linux package management -rpm
 “linux package management” -rpm
 linux OR windows
 rpm site:redhat.com
 linux faq filetype:pdf
 Info
 Text-base, menu-based help from GNU
 ?, h, u, t, ^N, ^P, Enter
 $ info info
Basic Commands
 ls
 $ ls -l
 $ ls -a
 $ ls -la
 $ ls -l --sort=time
 $ ls -l --sort=size -r
 cd
 $ cd /usr/bin
 pwd
 $ pwd
 ~
 $ cd ~
 ~user
 $ cd ~weesan
 What will “cd ~/weesan” do?
 which
 $ which ls
 whereis
 $ whereis ls
 locate
 $ locate stdio.h
 $ locate iostream
 rpm
 $ rpm -q bash
 $ rpm -qa
 $ rpm -qa | sort | less
 find
 $ find / | grep stdio.h
 $ find /usr/include | grep stdio.h
Basic Commands (cont)
 echo
 $ echo “Hello World”
 $ echo -n “Hello World”
 cat
 $ cat /etc/motd
 $ cat /proc/cpuinfo
 cp
 $ cp foo bar
 $ cp -a foo bar
 mv
 $ mv foo bar
 mkdir
 $ mkdir foo
 rm
 $ rm foo
 $ rm -rf foo
 $ rm -i foo
 $ rm -- -foo
 chgrp
 $ chgrp bar /home/foo
 chsh
 $ chsh foo
 chfn
 $ chfn foo
 chown
 $ chown -R foo:bar /home/foo
Basic Commands (cont)
 tar
 $ tar cvfp lab1.tar lab1
 gzip
 $ gzip -9 lab1.tar
 untar & ungzip
 $ gzip -cd lab1.tar.gz | tar xvf –
 $ tar xvfz lab1.tar.gz
 touch
 $ touch foo
 $ cat /dev/null > foo
 Pipe
 $ cal > foo
 $ cat /dev/zero > foo
 $ cat < /etc/passwd
 $ who | cut -d’ ‘ -f1 | sort |
uniq | wc –l
 backtick
 $ echo “The date is `date`”
 $ echo `seq 1 10`
 Hard, soft (symbolic) link
 ln vmlinuz-2.6.24.4 vmlinuz
 ln -s firefox-2.0.0.3 firefox
Basic Commands (cont)
 Disk usage
 $ df -h /
 File space usage
 $ du -sxh ~/
 Advance stuff 
 $ ssh eon who
 $ ssh eon ‘cd .html ; tar cvfp - cs183 | gzip -9c’ | tar
xvfpz -
 $ ssh kilo-1 ‘tar cvfp - /extra/weesan’ | tar xvfp - -C /
Vi
 2 modes
 Input mode
 ESC to back to cmd mode
 Command mode
 Cursor movement
 h (left), j (down), k (up), l (right)
 ^f (page down)
 ^b (page up)
 ^ (first char.)
 $ (last char.)
 G (bottom page)
 :1 (goto first line)
 Swtch to input mode
 a (append)
 i (insert)
 o (insert line after
 O (insert line before)
 Delete
 dd (delete a line)
 d10d (delete 10 lines)
 d$ (delete till end of line)
 dG (delete till end of file)
 x (current char.)
 Paste
 p (paste after)
 P (paste before)
 Undo
 u
 Search
 /
 Save/Quit
 :w (write)
 :q (quit)
 :wq (write and quit)
 :q! (give up changes)
Emacs
 $ emacs
 Cursor movement
 ^f (forward one char.)
 ^b (backward one char.)
 ^a (begin of line)
 ^e (end of line)
 ^n (next line)
 ^p (prev. line)
 ^v (page up)
 alt-v (page down)
 Deletion
 ^d (delete one char)
 alt-d (delete one word)
 ^k (delete line)
 Paste
 ^y (yank)
 Undo
 ^/
 Load file
 ^x^f
 Cancel
 ^g
 Save/Quit
 ^x^c (quit w/out saving)
 ^x^s (save)
 ^x^w (write to a new file)
Thank you

Contenu connexe

Tendances

Container Security
Container SecurityContainer Security
Container Securityamouat
 
Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012rivierarb
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basicsManav Prasad
 
Vim Script Programming
Vim Script ProgrammingVim Script Programming
Vim Script ProgrammingLin Yo-An
 
About linux japanese
About linux japaneseAbout linux japanese
About linux japaneseShota Ito
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...Zyxware Technologies
 
DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foobrian_dailey
 
3.1.a linux commands reference
3.1.a linux commands reference3.1.a linux commands reference
3.1.a linux commands referenceAcácio Oliveira
 
Introduction to shell scripting
Introduction to shell scriptingIntroduction to shell scripting
Introduction to shell scriptingCorrado Santoro
 
Unix Basics
Unix BasicsUnix Basics
Unix BasicsDr.Ravi
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linuxshravan saini
 
Gdc09 Minimissile
Gdc09 MinimissileGdc09 Minimissile
Gdc09 MinimissileSusan Gold
 
File-I/O -- ist doch ganz einfach, oder?
File-I/O -- ist doch ganz einfach, oder?File-I/O -- ist doch ganz einfach, oder?
File-I/O -- ist doch ganz einfach, oder?Christian Kauhaus
 

Tendances (20)

Vim Notes
Vim NotesVim Notes
Vim Notes
 
Container Security
Container SecurityContainer Security
Container Security
 
Php&redis presentation
Php&redis presentationPhp&redis presentation
Php&redis presentation
 
Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012Pry at the Ruby Drink-up of Sophia, February 2012
Pry at the Ruby Drink-up of Sophia, February 2012
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
 
Vim Script Programming
Vim Script ProgrammingVim Script Programming
Vim Script Programming
 
Comets notes
Comets notesComets notes
Comets notes
 
About linux japanese
About linux japaneseAbout linux japanese
About linux japanese
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
 
DevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung FooDevChatt 2010 - *nix Cmd Line Kung Foo
DevChatt 2010 - *nix Cmd Line Kung Foo
 
3.1.a linux commands reference
3.1.a linux commands reference3.1.a linux commands reference
3.1.a linux commands reference
 
gitfs
gitfsgitfs
gitfs
 
Introduction to shell scripting
Introduction to shell scriptingIntroduction to shell scripting
Introduction to shell scripting
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
 
Crystal Rocks
Crystal RocksCrystal Rocks
Crystal Rocks
 
Gdc09 Minimissile
Gdc09 MinimissileGdc09 Minimissile
Gdc09 Minimissile
 
Unix shell scripting
Unix shell scriptingUnix shell scripting
Unix shell scripting
 
File-I/O -- ist doch ganz einfach, oder?
File-I/O -- ist doch ganz einfach, oder?File-I/O -- ist doch ganz einfach, oder?
File-I/O -- ist doch ganz einfach, oder?
 

Similaire à Linux Basics

Similaire à Linux Basics (20)

10.8.2018
10.8.201810.8.2018
10.8.2018
 
01_linux_basics.ppt
01_linux_basics.ppt01_linux_basics.ppt
01_linux_basics.ppt
 
Linux history & features
Linux history & featuresLinux history & features
Linux history & features
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformatics
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpoint
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 
Introduction to-linux
Introduction to-linuxIntroduction to-linux
Introduction to-linux
 
Introduction-to-Linux.pptx
Introduction-to-Linux.pptxIntroduction-to-Linux.pptx
Introduction-to-Linux.pptx
 

Plus de sathish sak

TRANSPARENT CONCRE
TRANSPARENT CONCRETRANSPARENT CONCRE
TRANSPARENT CONCREsathish sak
 
Stationary Waves
Stationary WavesStationary Waves
Stationary Wavessathish sak
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heartsathish sak
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heartsathish sak
 
Software process life cycles
Software process life cyclesSoftware process life cycles
Software process life cycles sathish sak
 
Digital Logic Circuits
Digital Logic CircuitsDigital Logic Circuits
Digital Logic Circuitssathish sak
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Schedulingsathish sak
 
Real-Time Signal Processing: Implementation and Application
Real-Time Signal Processing:  Implementation and ApplicationReal-Time Signal Processing:  Implementation and Application
Real-Time Signal Processing: Implementation and Applicationsathish sak
 
DIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEWDIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEWsathish sak
 
FRACTAL ROBOTICS
FRACTAL  ROBOTICSFRACTAL  ROBOTICS
FRACTAL ROBOTICSsathish sak
 
POWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANTPOWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANTsathish sak
 
mathematics application fiels of engineering
mathematics application fiels of engineeringmathematics application fiels of engineering
mathematics application fiels of engineeringsathish sak
 
ENVIRONMENTAL POLLUTION
ENVIRONMENTALPOLLUTIONENVIRONMENTALPOLLUTION
ENVIRONMENTAL POLLUTIONsathish sak
 

Plus de sathish sak (20)

TRANSPARENT CONCRE
TRANSPARENT CONCRETRANSPARENT CONCRE
TRANSPARENT CONCRE
 
Stationary Waves
Stationary WavesStationary Waves
Stationary Waves
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
 
Electrical Activity of the Heart
Electrical Activity of the HeartElectrical Activity of the Heart
Electrical Activity of the Heart
 
Software process life cycles
Software process life cyclesSoftware process life cycles
Software process life cycles
 
Digital Logic Circuits
Digital Logic CircuitsDigital Logic Circuits
Digital Logic Circuits
 
Real-Time Scheduling
Real-Time SchedulingReal-Time Scheduling
Real-Time Scheduling
 
Real-Time Signal Processing: Implementation and Application
Real-Time Signal Processing:  Implementation and ApplicationReal-Time Signal Processing:  Implementation and Application
Real-Time Signal Processing: Implementation and Application
 
DIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEWDIGITAL SIGNAL PROCESSOR OVERVIEW
DIGITAL SIGNAL PROCESSOR OVERVIEW
 
FRACTAL ROBOTICS
FRACTAL  ROBOTICSFRACTAL  ROBOTICS
FRACTAL ROBOTICS
 
Electro bike
Electro bikeElectro bike
Electro bike
 
ROBOTIC SURGERY
ROBOTIC SURGERYROBOTIC SURGERY
ROBOTIC SURGERY
 
POWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANTPOWER GENERATION OF THERMAL POWER PLANT
POWER GENERATION OF THERMAL POWER PLANT
 
mathematics application fiels of engineering
mathematics application fiels of engineeringmathematics application fiels of engineering
mathematics application fiels of engineering
 
Plastics…
Plastics…Plastics…
Plastics…
 
ENGINEERING
ENGINEERINGENGINEERING
ENGINEERING
 
ENVIRONMENTAL POLLUTION
ENVIRONMENTALPOLLUTIONENVIRONMENTALPOLLUTION
ENVIRONMENTAL POLLUTION
 
RFID TECHNOLOGY
RFID TECHNOLOGYRFID TECHNOLOGY
RFID TECHNOLOGY
 
green chemistry
green chemistrygreen chemistry
green chemistry
 
NANOTECHNOLOGY
  NANOTECHNOLOGY	  NANOTECHNOLOGY
NANOTECHNOLOGY
 

Dernier

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
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.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 

Dernier (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation 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
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Linux Basics

  • 2. Roadmap  What is Unix?  What is Linux?  Which Linux Distribution is better?  Fish vs. Fishing  Basic Commands  Vi and Emacs  Q&A  References
  • 3. What is Unix?  A multi-task and multi-user Operating System  Developed in 1969 at AT&T’s Bell Labs by  Ken Thompson (Unix)  Dennis Ritchie (C)  Douglas Mcllroy (Pipes - Do one thing, do it well)  Some other variants: System V, Solaris, SCO Unix, SunOS, 4.4BSD, FreeBSD, NetBSD, OpenBSD, BSDI
  • 4. What is Linux?  A clone of Unix  Developed in 1991 by Linus Torvalds, a Finnish graduate student  Inspired by and replacement of Minix  Linus' Minix became Linux  Consist of  Linux Kernel  GNU (GNU is Not Unix) Software  Software Package management  Others http://www.linuxdevices.com/files/misc/ibm-watchpad.jpg
  • 5. What is Linux?  Originally developed for 32-bit x86-based PC  Ported to other architectures, eg.  Alpha, VAX, PowerPC, IBM S/390, MIPS, IA-64  PS2, TiVo, cellphones, watches, Nokia N810, NDS, routers, NAS, GPS, … * See references at the end for the corresponding websites.
  • 6. Which Linux Distribution is better?  > 300 Linux Distributions  Slackware (one of the oldest, simple and stable distro.)  Redhat  RHEL (commercially support)  Fedora (free)  CentOS (free RHEL, based in England)  SuSe ( based in German)  Gentoo (Source code based)  Debian (one of the few called GNU/Linux)  Ubuntu (based in South Africa)  Knoppix (first LiveCD distro.)  …
  • 7. Which Linux Distribution is better? Source: http://futurist.se/gldt/ CentOS Ubuntu Knoppix GentooSlackware Redhat Debian
  • 8. Which Linux Distribution is better?  Ask yourself these questions (from LAH)  Is it going to be around in 5 yrs?  Is it giong to stay on top of the latest security patches?  Is it going to release updated software promptly?  If I have problems, will the vendor talk to me?  Personally, I use Slackware  But, we will use CentOS (possibly along with Slackware :)
  • 9. Fish vs. Fishing  Manpage  $ man ls  $ man 2 mkdir  $ man man  $ man -k mkdir  Manpage sections (LAH Table 1.2 @ page 12)  1 User-level cmds and apps  /bin/mkdir  2 System calls  int mkdir(const char *, …);  3 Library calls  int printf(const char *, …);  4 Device drivers and network protocols  /dev/tty  5 Standard file formats  /etc/hosts  6 Games and demos  /usr/games/fortune  7 Misc. files and docs  man 7 locale  8 System admin. Cmds  /sbin/reboot  $ manpath  $ env | grep MANPATH  /etc/man.config
  • 10. Fish vs. Fishing (cont)  Google  linux package management -rpm  “linux package management” -rpm  linux OR windows  rpm site:redhat.com  linux faq filetype:pdf  Info  Text-base, menu-based help from GNU  ?, h, u, t, ^N, ^P, Enter  $ info info
  • 11. Basic Commands  ls  $ ls -l  $ ls -a  $ ls -la  $ ls -l --sort=time  $ ls -l --sort=size -r  cd  $ cd /usr/bin  pwd  $ pwd  ~  $ cd ~  ~user  $ cd ~weesan  What will “cd ~/weesan” do?  which  $ which ls  whereis  $ whereis ls  locate  $ locate stdio.h  $ locate iostream  rpm  $ rpm -q bash  $ rpm -qa  $ rpm -qa | sort | less  find  $ find / | grep stdio.h  $ find /usr/include | grep stdio.h
  • 12. Basic Commands (cont)  echo  $ echo “Hello World”  $ echo -n “Hello World”  cat  $ cat /etc/motd  $ cat /proc/cpuinfo  cp  $ cp foo bar  $ cp -a foo bar  mv  $ mv foo bar  mkdir  $ mkdir foo  rm  $ rm foo  $ rm -rf foo  $ rm -i foo  $ rm -- -foo  chgrp  $ chgrp bar /home/foo  chsh  $ chsh foo  chfn  $ chfn foo  chown  $ chown -R foo:bar /home/foo
  • 13. Basic Commands (cont)  tar  $ tar cvfp lab1.tar lab1  gzip  $ gzip -9 lab1.tar  untar & ungzip  $ gzip -cd lab1.tar.gz | tar xvf –  $ tar xvfz lab1.tar.gz  touch  $ touch foo  $ cat /dev/null > foo  Pipe  $ cal > foo  $ cat /dev/zero > foo  $ cat < /etc/passwd  $ who | cut -d’ ‘ -f1 | sort | uniq | wc –l  backtick  $ echo “The date is `date`”  $ echo `seq 1 10`  Hard, soft (symbolic) link  ln vmlinuz-2.6.24.4 vmlinuz  ln -s firefox-2.0.0.3 firefox
  • 14. Basic Commands (cont)  Disk usage  $ df -h /  File space usage  $ du -sxh ~/  Advance stuff   $ ssh eon who  $ ssh eon ‘cd .html ; tar cvfp - cs183 | gzip -9c’ | tar xvfpz -  $ ssh kilo-1 ‘tar cvfp - /extra/weesan’ | tar xvfp - -C /
  • 15. Vi  2 modes  Input mode  ESC to back to cmd mode  Command mode  Cursor movement  h (left), j (down), k (up), l (right)  ^f (page down)  ^b (page up)  ^ (first char.)  $ (last char.)  G (bottom page)  :1 (goto first line)  Swtch to input mode  a (append)  i (insert)  o (insert line after  O (insert line before)  Delete  dd (delete a line)  d10d (delete 10 lines)  d$ (delete till end of line)  dG (delete till end of file)  x (current char.)  Paste  p (paste after)  P (paste before)  Undo  u  Search  /  Save/Quit  :w (write)  :q (quit)  :wq (write and quit)  :q! (give up changes)
  • 16. Emacs  $ emacs  Cursor movement  ^f (forward one char.)  ^b (backward one char.)  ^a (begin of line)  ^e (end of line)  ^n (next line)  ^p (prev. line)  ^v (page up)  alt-v (page down)  Deletion  ^d (delete one char)  alt-d (delete one word)  ^k (delete line)  Paste  ^y (yank)  Undo  ^/  Load file  ^x^f  Cancel  ^g  Save/Quit  ^x^c (quit w/out saving)  ^x^s (save)  ^x^w (write to a new file)