SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
Random Unix
 Ramblings
       Bill C. Miller
AllPlayers.com eat-n-geek
         7/26/12
Very Brief History of Unix...
● GE / Bell Labs / MIT joined together on
  Multics project way back in 1965 (MAC -
  Multiple Access Computers project)
   ○ simultaneous computer access to large
     community (1st time share)
   ○ easy data sharing between users


● AT&T/ Bell Labs says enough we are
  stopping multics project it failed (1969)

● Multics later finished in 1972
Very Brief History of Unix...

● Ken Thompson/Dennis Ritchie work on it
  on their own as they needed on OS for a
  PDP-7 to play space travel game

● The result was system which a punning
  colleague called UNICS (UNiplexed
  Information and Computing Service) -- an
  'emasculated Multics'; soon changed to
  UNIX
UNIX Created
● Designed to be small and simple OS

● 1st written on PDP-7 in 1969, then PDP-
  11 on 1970

● 1973, Ritchie and Thompson rewrote
  kernel in C as 1st portable operating
  system (hardware independent)
Flavors of *nix
● ATT (BTL) UNIX
● BSD UNIX - ATT gave source code to
  universities since not in computer
  business, and was picked up by Berkley
  forking to BSD 1977
● SUNos from BSD as well as openbsd,
  netbsd, next, macos
● Xenix - MS's UNIX, later by SCO
● ATT goes commercial system V - 1979
● Posix standard to get best of BSD and V
● Linux
Error Code.. bah hum bug...
ON being told most of the code being written
for multics was for error recovery
   Ritchie -- "We left all that stuff out. If
there's an error, we have this routine called
panic, and when it is called, the machine
crashes, and you holler down the hall, "Hey,
reboot it"
UNIX Hall of Fame
● Ken Thompson - b, fortran,ed, sort,grep,
  uniq, plot,dd,..
● Dennis Ritchie - C, fork-exec,db,ed,
  fortran
● Steve Bourne - bourne shell (sh), adb,..
● Bill Joy - BSD UNIX, vi, csh, and founder
  of SUN micro, adding TCP/IP to BSD..
● Brian Kernigham - name UNIX, awk, troff,
  eqn,..
UNIX Hall of Fame


● David Korn - Korn shell,..
● Richard Stallman -- FSF, emacs, GNU,..
● Brian Fox - bash shell while at FSF,
  emacs maintainer, GNU tools
● Linus Torvalds -- LINUX using GNU tools
UNIX NUT


2 - Tools/APPS -- commands and programs
  -- applications, programs
1 - SHell -- interprets commands, executes
programs, and internal commands
  -- system calls, libraries
0 - Kernel -- schedules tasks and manages
storage and devices
   -- Hardware
The Power of UNIX
● Multi-user
● Multi-tasking
● Portable (hardware independent)
● Extensible (easy to add to scripts,
  commands, ...)
● Robust (rare crashing, permissions,
  simple filesystem used for files,disks,
  devices, pipes,...)
● Tools (many from the early days to years
  and years of contributed tools) -- modular
The Power of UNIX
● disk's, directory -- all the same to a user,
  and easy to mount a disk anywhere
● easy to navigate hierarchical file system
  and links
● file system i/o, is all the same regardless if
  a file, device, network stream, pipe, stdin
  (fd = 0) ,stdout (fd = 1) , stderr (fd =2), - ,
  /dev/null
   ○ all progs have access to stdin/stdout/stderr
Some special chars
● # -- comment
● ; -- chain commands
●  -- extend a line or quote char
● < > -- redirect input , output
● << >> -- redirect append input , output
| -- pipe output
● ` -- run command and place output as ..
● " -- quote input as a unit
● ' -- quote without variable replace
Some special chars


●   & -- run command in background
●   ? , *, [a-z] char matching..
●   ~ , users home dir shortcut
●   cat file >afile 2>&1   (stderr to stdout)
    ○ but not cat file 2>&1 >afile
● .....
Some Terminal Control Chars
●   ^o - flush
●   ^s - stop
●   ^q - start
●   ^z- background (&, fg, bg, and %#)
●   ^c - interrupt
●   ^u - kill
●   ^d - end input
●   ^ - terminate with core file
●   ......
Command line editing
● used emacs bindings on linux unless
  exported env for VISUAL or EDITOR
● ^a - front of line, ESC-a (sentence)
● ^e - end of line, ESC-e (sentence)
● ^k - kill line
● ^y - yank kill ring
● ^p - previous line
● ^n - Next line
● <tab> completion for files
Command line editing


●   ^f - foward char , ESC-f (word)
●   ^b - back char , ESC-b (word)
●   ^s - search forward, ^r search backward
●   .....
Common directories

● /tmp
● /dev/null
● / or /root
● /home
● /usr (/usr/local, /usr/bin, /usr/lib)
● /var (/var/log,/var/lib, /var/tmp, /var/run,
  /var/crash,/var/mail,/var/spool,/var/local)
● /opt
UNIX tools............
● some shell built-ins, many std, and many
  add-ons
● Directory navigation / Files
  ○   cd, pwd
  ○   pushd, popd
  ○   ls
  ○   file
  ○   strings
  ○   which
  ○   whereis
File & display commands
●   find
●   locate
●   touch
●   mkfile
●   sum
●   nl, wc
●   cat, zcat, od, hd, echo
●   grep, egrep
●   more, less, pg
●   head
●   tail
Various
●   man, man -k
●   clear
●   stty
●   script
●   tee
●   xargs
●   bc
●   banner
●   fortune
●   spell
Manipulate text strings +
●   sed, ed
●   awk
●   cut
●   sort
●   uniq
●   tr
Host related
●   w
●   who
●   finger
●   uptime
●   uname
●   hostname
●   last
●   top
●   date , cal
Command Control
●   time
●   watch
●   sleep
●   kill, pkill, killall
●   nohup
●   nice, renice
●   ps
●   cron, at
Debugging , monitoring
●   lsof
●   gdb
●   strace, ptrace, truss
●   fuser
●   ldd
●   nm
stats performance
●   sar
●   iostat
●   vmstat
●   mpstat
●   ipcs,ipcrm
●   nfsstat
●
Network
●   ifconfig
●   netstat
●   route
●   tcpdump,snoop
●   nettop
●   nslookup, dig,
●   ping, traceroute
●   iptables, ipchains
disk
●   df
●   du
●   mount
●   exportfs
●   fdisk
●   dd
●   mkfs
●   tar, dump
Permissions and account
 ●   su
 ●   chmod
 ●   chown
 ●   chgrp
 ●   groups
 ●   passwd
 ●   login
 ●   acl

Más contenido relacionado

La actualidad más candente

Linux containers_Docker
Linux containers_DockerLinux containers_Docker
Linux containers_Docker
Dmitry Fedorov
 
EuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD SystemsEuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD Systems
Vinícius Zavam
 

La actualidad más candente (20)

軽快なPlan9 (第三回Kernel/VM探検隊)
軽快なPlan9 (第三回Kernel/VM探検隊)軽快なPlan9 (第三回Kernel/VM探検隊)
軽快なPlan9 (第三回Kernel/VM探検隊)
 
Plan 9のお話
Plan 9のお話Plan 9のお話
Plan 9のお話
 
Unix 6 en
Unix 6 enUnix 6 en
Unix 6 en
 
Linux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.comLinux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.com
 
LSA2 - 02 Namespaces
LSA2 - 02  NamespacesLSA2 - 02  Namespaces
LSA2 - 02 Namespaces
 
LSA2 - PostgreSQL
LSA2 - PostgreSQLLSA2 - PostgreSQL
LSA2 - PostgreSQL
 
My First XDP (eXpress Data Path)
My First XDP (eXpress Data Path)My First XDP (eXpress Data Path)
My First XDP (eXpress Data Path)
 
Containers from scratch
Containers from scratchContainers from scratch
Containers from scratch
 
Linux containers_Docker
Linux containers_DockerLinux containers_Docker
Linux containers_Docker
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System Workshop
 
EuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD SystemsEuroBSDCon 2021 - (auto)Installing BSD Systems
EuroBSDCon 2021 - (auto)Installing BSD Systems
 
Glusterfs session #18 intro to fuse and its trade offs
Glusterfs session #18 intro to fuse and its trade offsGlusterfs session #18 intro to fuse and its trade offs
Glusterfs session #18 intro to fuse and its trade offs
 
Introduction to Free and Open Source Software - August 2005
Introduction to Free and Open Source Software - August 2005Introduction to Free and Open Source Software - August 2005
Introduction to Free and Open Source Software - August 2005
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
 
Plan 9でWebプログラミング
Plan 9でWebプログラミングPlan 9でWebプログラミング
Plan 9でWebプログラミング
 
Parallel computing in bioinformatics t.seemann - balti bioinformatics - wed...
Parallel computing in bioinformatics   t.seemann - balti bioinformatics - wed...Parallel computing in bioinformatics   t.seemann - balti bioinformatics - wed...
Parallel computing in bioinformatics t.seemann - balti bioinformatics - wed...
 
Glusterfs session #13 replication introduction
Glusterfs session #13   replication introductionGlusterfs session #13   replication introduction
Glusterfs session #13 replication introduction
 
My First F-Stack
My First F-StackMy First F-Stack
My First F-Stack
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
Vim
VimVim
Vim
 

Destacado (6)

Teen Safety
Teen SafetyTeen Safety
Teen Safety
 
Week Of 2009 09 14 E9 21225
Week Of 2009 09 14 E9 21225Week Of 2009 09 14 E9 21225
Week Of 2009 09 14 E9 21225
 
Week Of 2009 09 07 Dol
Week Of 2009 09 07 DolWeek Of 2009 09 07 Dol
Week Of 2009 09 07 Dol
 
Healthreform Sbs Full
Healthreform Sbs FullHealthreform Sbs Full
Healthreform Sbs Full
 
Internet and DNS evolution
Internet and DNS evolutionInternet and DNS evolution
Internet and DNS evolution
 
Week Of 2009 08 10
Week Of 2009 08 10Week Of 2009 08 10
Week Of 2009 08 10
 

Similar a Unix Ramblings

Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
Mustafa Qasim
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in Hyderabad
Ravikumar Nandigam
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Docker, Inc.
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
Chander Pandey
 

Similar a Unix Ramblings (20)

Tips and Tricks for Increased Development Efficiency
Tips and Tricks for Increased Development EfficiencyTips and Tricks for Increased Development Efficiency
Tips and Tricks for Increased Development Efficiency
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Linux Knowledge Transfer
Linux Knowledge TransferLinux Knowledge Transfer
Linux Knowledge Transfer
 
Introduction to Docker (as presented at December 2013 Global Hackathon)
Introduction to Docker (as presented at December 2013 Global Hackathon)Introduction to Docker (as presented at December 2013 Global Hackathon)
Introduction to Docker (as presented at December 2013 Global Hackathon)
 
Adhocr T-dose 2012
Adhocr T-dose 2012Adhocr T-dose 2012
Adhocr T-dose 2012
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in Hyderabad
 
Linux introduction (eng)
Linux introduction (eng)Linux introduction (eng)
Linux introduction (eng)
 
Bsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdBsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsd
 
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo..."Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
FreeBSD and Drivers
FreeBSD and DriversFreeBSD and Drivers
FreeBSD and Drivers
 
FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016FreeBSD Portscamp, Kuala Lumpur 2016
FreeBSD Portscamp, Kuala Lumpur 2016
 
Bsdtw17: ruslan bukin: free bsd/risc-v and device drivers
Bsdtw17: ruslan bukin: free bsd/risc-v and device driversBsdtw17: ruslan bukin: free bsd/risc-v and device drivers
Bsdtw17: ruslan bukin: free bsd/risc-v and device drivers
 
Description of GRUB 2
Description of GRUB 2Description of GRUB 2
Description of GRUB 2
 
Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet Linux Commands - Cheat Sheet
Linux Commands - Cheat Sheet
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
Dev day linux redu
Dev day linux reduDev day linux redu
Dev day linux redu
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
 

Unix Ramblings

  • 1. Random Unix Ramblings Bill C. Miller AllPlayers.com eat-n-geek 7/26/12
  • 2. Very Brief History of Unix... ● GE / Bell Labs / MIT joined together on Multics project way back in 1965 (MAC - Multiple Access Computers project) ○ simultaneous computer access to large community (1st time share) ○ easy data sharing between users ● AT&T/ Bell Labs says enough we are stopping multics project it failed (1969) ● Multics later finished in 1972
  • 3. Very Brief History of Unix... ● Ken Thompson/Dennis Ritchie work on it on their own as they needed on OS for a PDP-7 to play space travel game ● The result was system which a punning colleague called UNICS (UNiplexed Information and Computing Service) -- an 'emasculated Multics'; soon changed to UNIX
  • 4. UNIX Created ● Designed to be small and simple OS ● 1st written on PDP-7 in 1969, then PDP- 11 on 1970 ● 1973, Ritchie and Thompson rewrote kernel in C as 1st portable operating system (hardware independent)
  • 5. Flavors of *nix ● ATT (BTL) UNIX ● BSD UNIX - ATT gave source code to universities since not in computer business, and was picked up by Berkley forking to BSD 1977 ● SUNos from BSD as well as openbsd, netbsd, next, macos ● Xenix - MS's UNIX, later by SCO ● ATT goes commercial system V - 1979 ● Posix standard to get best of BSD and V ● Linux
  • 6. Error Code.. bah hum bug... ON being told most of the code being written for multics was for error recovery Ritchie -- "We left all that stuff out. If there's an error, we have this routine called panic, and when it is called, the machine crashes, and you holler down the hall, "Hey, reboot it"
  • 7. UNIX Hall of Fame ● Ken Thompson - b, fortran,ed, sort,grep, uniq, plot,dd,.. ● Dennis Ritchie - C, fork-exec,db,ed, fortran ● Steve Bourne - bourne shell (sh), adb,.. ● Bill Joy - BSD UNIX, vi, csh, and founder of SUN micro, adding TCP/IP to BSD.. ● Brian Kernigham - name UNIX, awk, troff, eqn,..
  • 8. UNIX Hall of Fame ● David Korn - Korn shell,.. ● Richard Stallman -- FSF, emacs, GNU,.. ● Brian Fox - bash shell while at FSF, emacs maintainer, GNU tools ● Linus Torvalds -- LINUX using GNU tools
  • 9. UNIX NUT 2 - Tools/APPS -- commands and programs -- applications, programs 1 - SHell -- interprets commands, executes programs, and internal commands -- system calls, libraries 0 - Kernel -- schedules tasks and manages storage and devices -- Hardware
  • 10. The Power of UNIX ● Multi-user ● Multi-tasking ● Portable (hardware independent) ● Extensible (easy to add to scripts, commands, ...) ● Robust (rare crashing, permissions, simple filesystem used for files,disks, devices, pipes,...) ● Tools (many from the early days to years and years of contributed tools) -- modular
  • 11. The Power of UNIX ● disk's, directory -- all the same to a user, and easy to mount a disk anywhere ● easy to navigate hierarchical file system and links ● file system i/o, is all the same regardless if a file, device, network stream, pipe, stdin (fd = 0) ,stdout (fd = 1) , stderr (fd =2), - , /dev/null ○ all progs have access to stdin/stdout/stderr
  • 12. Some special chars ● # -- comment ● ; -- chain commands ● -- extend a line or quote char ● < > -- redirect input , output ● << >> -- redirect append input , output | -- pipe output ● ` -- run command and place output as .. ● " -- quote input as a unit ● ' -- quote without variable replace
  • 13. Some special chars ● & -- run command in background ● ? , *, [a-z] char matching.. ● ~ , users home dir shortcut ● cat file >afile 2>&1 (stderr to stdout) ○ but not cat file 2>&1 >afile ● .....
  • 14. Some Terminal Control Chars ● ^o - flush ● ^s - stop ● ^q - start ● ^z- background (&, fg, bg, and %#) ● ^c - interrupt ● ^u - kill ● ^d - end input ● ^ - terminate with core file ● ......
  • 15. Command line editing ● used emacs bindings on linux unless exported env for VISUAL or EDITOR ● ^a - front of line, ESC-a (sentence) ● ^e - end of line, ESC-e (sentence) ● ^k - kill line ● ^y - yank kill ring ● ^p - previous line ● ^n - Next line ● <tab> completion for files
  • 16. Command line editing ● ^f - foward char , ESC-f (word) ● ^b - back char , ESC-b (word) ● ^s - search forward, ^r search backward ● .....
  • 17. Common directories ● /tmp ● /dev/null ● / or /root ● /home ● /usr (/usr/local, /usr/bin, /usr/lib) ● /var (/var/log,/var/lib, /var/tmp, /var/run, /var/crash,/var/mail,/var/spool,/var/local) ● /opt
  • 18. UNIX tools............ ● some shell built-ins, many std, and many add-ons ● Directory navigation / Files ○ cd, pwd ○ pushd, popd ○ ls ○ file ○ strings ○ which ○ whereis
  • 19. File & display commands ● find ● locate ● touch ● mkfile ● sum ● nl, wc ● cat, zcat, od, hd, echo ● grep, egrep ● more, less, pg ● head ● tail
  • 20. Various ● man, man -k ● clear ● stty ● script ● tee ● xargs ● bc ● banner ● fortune ● spell
  • 21. Manipulate text strings + ● sed, ed ● awk ● cut ● sort ● uniq ● tr
  • 22. Host related ● w ● who ● finger ● uptime ● uname ● hostname ● last ● top ● date , cal
  • 23. Command Control ● time ● watch ● sleep ● kill, pkill, killall ● nohup ● nice, renice ● ps ● cron, at
  • 24. Debugging , monitoring ● lsof ● gdb ● strace, ptrace, truss ● fuser ● ldd ● nm
  • 25. stats performance ● sar ● iostat ● vmstat ● mpstat ● ipcs,ipcrm ● nfsstat ●
  • 26. Network ● ifconfig ● netstat ● route ● tcpdump,snoop ● nettop ● nslookup, dig, ● ping, traceroute ● iptables, ipchains
  • 27. disk ● df ● du ● mount ● exportfs ● fdisk ● dd ● mkfs ● tar, dump
  • 28. Permissions and account ● su ● chmod ● chown ● chgrp ● groups ● passwd ● login ● acl