SlideShare a Scribd company logo
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

More Related Content

PPT
01 linux basics
PDF
Zsh shell-for-humans
ODP
Linux Command Line
ODP
NUMOSS 4th Week - Commandline Tutorial
PDF
Zsh & fish: better *bash* for hackers
PPT
Linux basics by Raj Miraje
PDF
Linux command line
PPT
Unix Shell Scripting Basics
01 linux basics
Zsh shell-for-humans
Linux Command Line
NUMOSS 4th Week - Commandline Tutorial
Zsh & fish: better *bash* for hackers
Linux basics by Raj Miraje
Linux command line
Unix Shell Scripting Basics

What's hot (20)

PDF
Vim Notes
PDF
Container Security
PDF
Php&redis presentation
PDF
Pry at the Ruby Drink-up of Sophia, February 2012
PPTX
Unix shell scripting basics
PDF
Vim Script Programming
PPTX
Comets notes
PDF
About linux japanese
PDF
Unleash your inner console cowboy
PDF
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
ODP
DevChatt 2010 - *nix Cmd Line Kung Foo
PDF
3.1.a linux commands reference
PDF
PDF
Introduction to shell scripting
PPT
Unix Basics
PPTX
Basic commands of linux
PDF
Crystal Rocks
PPT
Gdc09 Minimissile
PPTX
Unix shell scripting
PDF
File-I/O -- ist doch ganz einfach, oder?
Vim Notes
Container Security
Php&redis presentation
Pry at the Ruby Drink-up of Sophia, February 2012
Unix shell scripting basics
Vim Script Programming
Comets notes
About linux japanese
Unleash your inner console cowboy
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...
DevChatt 2010 - *nix Cmd Line Kung Foo
3.1.a linux commands reference
Introduction to shell scripting
Unix Basics
Basic commands of linux
Crystal Rocks
Gdc09 Minimissile
Unix shell scripting
File-I/O -- ist doch ganz einfach, oder?
Ad

Similar to Linux Basics (20)

PPT
01_linux_basics tutorial for install.ppt
PPT
10.8.2018
PPT
01_linux_basics.ppt
PPT
Linux history & features
PDF
Basic linux commands for bioinformatics
PDF
Linux Presentation
PPT
Andresen 8 21 02
PDF
Shell scripting
PPT
Linux Commands
PPTX
Introduction to-linux
PPT
8.1.intro unix
ODP
DOCX
50 most frequently used unix
DOCX
50 most frequently used unix
PPTX
Linux powerpoint
ODP
Linuxppt
ODP
DOCX
50 Most Frequently Used UNIX Linux Commands -hmftj
PPTX
Introduction-to-Linux.pptx
PPTX
Introduction khgjkhygkjiyhgikjyhgikygkii
01_linux_basics tutorial for install.ppt
10.8.2018
01_linux_basics.ppt
Linux history & features
Basic linux commands for bioinformatics
Linux Presentation
Andresen 8 21 02
Shell scripting
Linux Commands
Introduction to-linux
8.1.intro unix
50 most frequently used unix
50 most frequently used unix
Linux powerpoint
Linuxppt
50 Most Frequently Used UNIX Linux Commands -hmftj
Introduction-to-Linux.pptx
Introduction khgjkhygkjiyhgikjyhgikygkii
Ad

More from sathish sak (20)

PPTX
TRANSPARENT CONCRE
PPT
Stationary Waves
PPT
Electrical Activity of the Heart
PPTX
Electrical Activity of the Heart
PPT
Software process life cycles
PPT
Digital Logic Circuits
PPT
Real-Time Scheduling
PPT
Real-Time Signal Processing: Implementation and Application
PPT
DIGITAL SIGNAL PROCESSOR OVERVIEW
PPTX
FRACTAL ROBOTICS
PPTX
Electro bike
PPTX
ROBOTIC SURGERY
PPTX
POWER GENERATION OF THERMAL POWER PLANT
PPT
mathematics application fiels of engineering
PPT
Plastics…
PPTX
ENGINEERING
PPTX
ENVIRONMENTAL POLLUTION
PPTX
RFID TECHNOLOGY
PPT
green chemistry
PPT
NANOTECHNOLOGY
TRANSPARENT CONCRE
Stationary Waves
Electrical Activity of the Heart
Electrical Activity of the Heart
Software process life cycles
Digital Logic Circuits
Real-Time Scheduling
Real-Time Signal Processing: Implementation and Application
DIGITAL SIGNAL PROCESSOR OVERVIEW
FRACTAL ROBOTICS
Electro bike
ROBOTIC SURGERY
POWER GENERATION OF THERMAL POWER PLANT
mathematics application fiels of engineering
Plastics…
ENGINEERING
ENVIRONMENTAL POLLUTION
RFID TECHNOLOGY
green chemistry
NANOTECHNOLOGY

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Spectroscopy.pptx food analysis technology
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
1. Introduction to Computer Programming.pptx
Teaching material agriculture food technology
Spectral efficient network and resource selection model in 5G networks
A comparative study of natural language inference in Swahili using monolingua...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Heart disease approach using modified random forest and particle swarm optimi...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Unlocking AI with Model Context Protocol (MCP)
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
SOPHOS-XG Firewall Administrator PPT.pptx
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
cloud_computing_Infrastucture_as_cloud_p
Advanced methodologies resolving dimensionality complications for autism neur...
Programs and apps: productivity, graphics, security and other tools
NewMind AI Weekly Chronicles - August'25-Week II
Spectroscopy.pptx food analysis technology
TLE Review Electricity (Electricity).pptx
Digital-Transformation-Roadmap-for-Companies.pptx
1. Introduction to Computer Programming.pptx

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)