SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Linux Basics
WeeSan Lee <weesan@cs.ucr.edu>
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
Roadmap
• What is Unix?
• What is Linux?
• Which Linux Distribution is better?
• Fish vs. Fishing
• Basic Commands
• Vi and Emacs
• Q&A
• References
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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, …
https://sites.google.com/site/rajmirjelinu
x/home
* See references at the end
for the corresponding websites.4/5/2014
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.)
– …
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
Which Linux Distribution is better?
https://sites.google.com/site/rajmirjelinu
x/home
Source:
http://futurist.se/gldt/
CentOS
Ubuntu
Knoppix
GentooSlackware
Redhat
Debian
4/5/2014
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 :)
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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 /
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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)
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
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)
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
Q&A
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
References
• LAH
– Ch 1: Where to Start
• Unix history
– http://en.wikipedia.org/wiki/Unix
– http://upload.wikimedia.org/wikipedia/commons/7/77/Unix_hi
story-simple.svg
• Linus Torvalds
– http://en.wikipedia.org/wiki/Linus_Torvalds
• Linux Kernel
– http://www.kernel.org/
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
References
• GNU (Gnu’s Not Unix)
– http://www.gnu.org/
• Linux Distribution
– http://en.wikipedia.org/wiki/Linux_distribution
– http://en.wikipedia.org/wiki/List_of_Linux_distributions
• PS2: Computational Cluster
– http://arrakis.ncsa.uiuc.edu/ps2/cluster.php
• Linux Gadgets
– http://linuxdevices.com/articles/AT4936596231.html
• TiVo
– http://dynamic.tivo.com/linux/linux.asp
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014
References
• Nintendo DS Lite
– http://www.nintendo.com/ds/
• Nokia N810
– http://www.nokia.com/
– http://www.engadget.com/2007/10/17/nokia-n810-gets-official/
• Linux Distribution
– http://en.wikipedia.org/wiki/Linux_distribution
– GNU/Linux Distro Timeline: http://futurist.se/gldt/
– http://www.distrowatch.com/
– http://www.linux.org/dist/
• Google Advance Search
– http://www.google.com/intl/en/help/refinesearch.html
https://sites.google.com/site/rajmirjelinu
x/home
4/5/2014

Weitere ähnliche Inhalte

Was ist angesagt?

Zsh & fish: better *bash* for hackers
Zsh & fish: better *bash* for hackersZsh & fish: better *bash* for hackers
Zsh & fish: better *bash* for hackersRuslan Sharipov
 
Ruby is an Acceptable Lisp
Ruby is an Acceptable LispRuby is an Acceptable Lisp
Ruby is an Acceptable LispAstrails
 
Python utan-stodhjul-motorsag
Python utan-stodhjul-motorsagPython utan-stodhjul-motorsag
Python utan-stodhjul-motorsagniklal
 
Zsh shell-for-humans
Zsh shell-for-humansZsh shell-for-humans
Zsh shell-for-humansJuan De Bravo
 
10 more-things-you-can-do-with-python
10 more-things-you-can-do-with-python10 more-things-you-can-do-with-python
10 more-things-you-can-do-with-pythonDaniel Greenfeld
 
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
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with GoSteven Francia
 
Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Steven Francia
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid themSteven Francia
 
Hide and seek - interesting uses of forensics and covert channels.
Hide and seek - interesting uses of forensics and covert channels.Hide and seek - interesting uses of forensics and covert channels.
Hide and seek - interesting uses of forensics and covert channels.tkisason
 
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialNUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialGagah Arifianto
 
Joshua Wehner - Tomorrows Programming Languages Today
Joshua Wehner - Tomorrows Programming Languages TodayJoshua Wehner - Tomorrows Programming Languages Today
Joshua Wehner - Tomorrows Programming Languages TodayRefresh Events
 

Was ist angesagt? (20)

Shell basic
Shell basicShell basic
Shell basic
 
Zsh & fish: better *bash* for hackers
Zsh & fish: better *bash* for hackersZsh & fish: better *bash* for hackers
Zsh & fish: better *bash* for hackers
 
Ruby is an Acceptable Lisp
Ruby is an Acceptable LispRuby is an Acceptable Lisp
Ruby is an Acceptable Lisp
 
gitfs
gitfsgitfs
gitfs
 
Where do Rubyists go?
 Where do Rubyists go?  Where do Rubyists go?
Where do Rubyists go?
 
Python utan-stodhjul-motorsag
Python utan-stodhjul-motorsagPython utan-stodhjul-motorsag
Python utan-stodhjul-motorsag
 
Hello world
Hello worldHello world
Hello world
 
Zsh shell-for-humans
Zsh shell-for-humansZsh shell-for-humans
Zsh shell-for-humans
 
10 more-things-you-can-do-with-python
10 more-things-you-can-do-with-python10 more-things-you-can-do-with-python
10 more-things-you-can-do-with-python
 
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
 
Vim Notes
Vim NotesVim Notes
Vim Notes
 
Getting Started with Go
Getting Started with GoGetting Started with Go
Getting Started with Go
 
Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Go for Object Oriented Programmers or Object Oriented Programming without Obj...
Go for Object Oriented Programmers or Object Oriented Programming without Obj...
 
Linux Command Line
Linux Command LineLinux Command Line
Linux Command Line
 
Unix 5 en
Unix 5 enUnix 5 en
Unix 5 en
 
7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them7 Common mistakes in Go and when to avoid them
7 Common mistakes in Go and when to avoid them
 
Hide and seek - interesting uses of forensics and covert channels.
Hide and seek - interesting uses of forensics and covert channels.Hide and seek - interesting uses of forensics and covert channels.
Hide and seek - interesting uses of forensics and covert channels.
 
Git installation
Git installationGit installation
Git installation
 
NUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline TutorialNUMOSS 4th Week - Commandline Tutorial
NUMOSS 4th Week - Commandline Tutorial
 
Joshua Wehner - Tomorrows Programming Languages Today
Joshua Wehner - Tomorrows Programming Languages TodayJoshua Wehner - Tomorrows Programming Languages Today
Joshua Wehner - Tomorrows Programming Languages Today
 

Andere mochten auch

Virtual Ocular System
Virtual Ocular SystemVirtual Ocular System
Virtual Ocular SystemNayan Seth
 
Fast Object Instance Search From One Example
Fast Object Instance Search From One ExampleFast Object Instance Search From One Example
Fast Object Instance Search From One ExampleNayan Seth
 
Introduction to Linux_by_Amit & Jiban
Introduction to Linux_by_Amit & Jiban Introduction to Linux_by_Amit & Jiban
Introduction to Linux_by_Amit & Jiban Amit Nath
 
Linux Environment- Linux Basics
Linux Environment- Linux BasicsLinux Environment- Linux Basics
Linux Environment- Linux BasicsTrinity Dwarka
 
Linux lesson
Linux lesson Linux lesson
Linux lesson mutharam
 
Basics of Linux
Basics of LinuxBasics of Linux
Basics of LinuxNayan Seth
 
Principles of Management- Management Process & Functions
Principles of Management- Management Process  &  FunctionsPrinciples of Management- Management Process  &  Functions
Principles of Management- Management Process & FunctionsTrinity Dwarka
 
Principles of Management-Management-Concept & Meaning
  Principles of Management-Management-Concept & Meaning  Principles of Management-Management-Concept & Meaning
Principles of Management-Management-Concept & MeaningTrinity Dwarka
 
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 Scriptsbmguys
 

Andere mochten auch (10)

Virtual Ocular System
Virtual Ocular SystemVirtual Ocular System
Virtual Ocular System
 
Fast Object Instance Search From One Example
Fast Object Instance Search From One ExampleFast Object Instance Search From One Example
Fast Object Instance Search From One Example
 
Introduction to Linux_by_Amit & Jiban
Introduction to Linux_by_Amit & Jiban Introduction to Linux_by_Amit & Jiban
Introduction to Linux_by_Amit & Jiban
 
Linux basics
Linux basics Linux basics
Linux basics
 
Linux Environment- Linux Basics
Linux Environment- Linux BasicsLinux Environment- Linux Basics
Linux Environment- Linux Basics
 
Linux lesson
Linux lesson Linux lesson
Linux lesson
 
Basics of Linux
Basics of LinuxBasics of Linux
Basics of Linux
 
Principles of Management- Management Process & Functions
Principles of Management- Management Process  &  FunctionsPrinciples of Management- Management Process  &  Functions
Principles of Management- Management Process & Functions
 
Principles of Management-Management-Concept & Meaning
  Principles of Management-Management-Concept & Meaning  Principles of Management-Management-Concept & Meaning
Principles of Management-Management-Concept & Meaning
 
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
 

Ähnlich wie Linux basics by Raj Miraje

01_linux_basics.ppt
01_linux_basics.ppt01_linux_basics.ppt
01_linux_basics.pptMahmood Adel
 
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012Jose L. Quiñones-Borrero
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commandsHimani Singh
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpointbijanshr
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linuxQIANG XU
 
Kamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with LuaKamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with LuaSebastian Damm
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
Creating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just WorksCreating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just WorksTim Callaghan
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformaticsBonnie Ng
 
Эффективная работа с рутинными задачами
Эффективная работа с рутинными задачамиЭффективная работа с рутинными задачами
Эффективная работа с рутинными задачамиCOMAQA.BY
 
LINUX_admin_commands.pptx
LINUX_admin_commands.pptxLINUX_admin_commands.pptx
LINUX_admin_commands.pptxGuhanSenthil2
 
Linux history & features
Linux history & featuresLinux history & features
Linux history & featuresRohit Kumar
 
Working Effectively with Routine Tasks
Working Effectively with Routine TasksWorking Effectively with Routine Tasks
Working Effectively with Routine TasksIvan Katunou
 
Surge2014 talk - illumos State of the Community & POSIX Update
Surge2014 talk - illumos State of the Community & POSIX UpdateSurge2014 talk - illumos State of the Community & POSIX Update
Surge2014 talk - illumos State of the Community & POSIX UpdateGarrett D'Amore
 

Ähnlich wie Linux basics by Raj Miraje (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 for Security Professionals (Tips and Tricks) - Init 6 10/2012
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commands
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Linux powerpoint
Linux powerpointLinux powerpoint
Linux powerpoint
 
Lpt lopsa
Lpt lopsaLpt lopsa
Lpt lopsa
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Kamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with LuaKamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with Lua
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
Creating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just WorksCreating a Benchmarking Infrastructure That Just Works
Creating a Benchmarking Infrastructure That Just Works
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformatics
 
Эффективная работа с рутинными задачами
Эффективная работа с рутинными задачамиЭффективная работа с рутинными задачами
Эффективная работа с рутинными задачами
 
LINUX_admin_commands.pptx
LINUX_admin_commands.pptxLINUX_admin_commands.pptx
LINUX_admin_commands.pptx
 
Linux history & features
Linux history & featuresLinux history & features
Linux history & features
 
Working Effectively with Routine Tasks
Working Effectively with Routine TasksWorking Effectively with Routine Tasks
Working Effectively with Routine Tasks
 
Linux 101
Linux 101Linux 101
Linux 101
 
Surge2014 talk - illumos State of the Community & POSIX Update
Surge2014 talk - illumos State of the Community & POSIX UpdateSurge2014 talk - illumos State of the Community & POSIX Update
Surge2014 talk - illumos State of the Community & POSIX Update
 

Kürzlich hochgeladen

IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119APNIC
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxNIMMANAGANTI RAMAKRISHNA
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxMario
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxAndrieCagasanAkio
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxmibuzondetrabajo
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 

Kürzlich hochgeladen (11)

IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptx
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptx
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptx
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptx
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 

Linux basics by Raj Miraje

  • 1. Linux Basics WeeSan Lee <weesan@cs.ucr.edu> https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 2. Roadmap • What is Unix? • What is Linux? • Which Linux Distribution is better? • Fish vs. Fishing • Basic Commands • Vi and Emacs • Q&A • References https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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 https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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 https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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, … https://sites.google.com/site/rajmirjelinu x/home * See references at the end for the corresponding websites.4/5/2014
  • 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.) – … https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 7. Which Linux Distribution is better? https://sites.google.com/site/rajmirjelinu x/home Source: http://futurist.se/gldt/ CentOS Ubuntu Knoppix GentooSlackware Redhat Debian 4/5/2014
  • 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 :) https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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 https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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 https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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 https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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 https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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 https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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 / https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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) https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 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) https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 18. References • LAH – Ch 1: Where to Start • Unix history – http://en.wikipedia.org/wiki/Unix – http://upload.wikimedia.org/wikipedia/commons/7/77/Unix_hi story-simple.svg • Linus Torvalds – http://en.wikipedia.org/wiki/Linus_Torvalds • Linux Kernel – http://www.kernel.org/ https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 19. References • GNU (Gnu’s Not Unix) – http://www.gnu.org/ • Linux Distribution – http://en.wikipedia.org/wiki/Linux_distribution – http://en.wikipedia.org/wiki/List_of_Linux_distributions • PS2: Computational Cluster – http://arrakis.ncsa.uiuc.edu/ps2/cluster.php • Linux Gadgets – http://linuxdevices.com/articles/AT4936596231.html • TiVo – http://dynamic.tivo.com/linux/linux.asp https://sites.google.com/site/rajmirjelinu x/home 4/5/2014
  • 20. References • Nintendo DS Lite – http://www.nintendo.com/ds/ • Nokia N810 – http://www.nokia.com/ – http://www.engadget.com/2007/10/17/nokia-n810-gets-official/ • Linux Distribution – http://en.wikipedia.org/wiki/Linux_distribution – GNU/Linux Distro Timeline: http://futurist.se/gldt/ – http://www.distrowatch.com/ – http://www.linux.org/dist/ • Google Advance Search – http://www.google.com/intl/en/help/refinesearch.html https://sites.google.com/site/rajmirjelinu x/home 4/5/2014