ࡱ> Ig  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHdLMNOPQRSTUVWXYZ[\]^_`abcefRdO)ЪJPowerPoint Document(SummaryInformation(K(0DocumentSummaryInformation8,/(  b jVhttp://www.nd.edu/~srussel2/macintosh/bash/N':http://tldp.org/LDP/abs/html/?rhttp://unixnotes.wordpress.com/2006/03/15/awk-one-liners/F2http://www.nd.edu/~ndmac/http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.htmlF/ 0|DTimesngsRoma`ss&LDPalatinoRoma`ss&L DTimes New Roman`ss&L0DWingdingsRoman`ss&L@DArialngsRoman`ss&L" ` .  @n?" dd@  @@`` h,O **21FH 5>>    c $@8]uʚ;r7+1ʚ;g4BdBds{رnp ppp@ <4!d!d`pgʚ;<4dddd`pgʚ; <4BdBd`pʚ;b___PPT9D< h___PPT2001D<4X? %$BASH Shell PrimerbScott Russell IT Support Engineer Distributed Support Services Office of Information Technologies(c T TBasic Shell Commandsls -- list directory contents touch -- change file access and modification times (create files) mkdir -- make directories cp -- copy files mv -- move (rename) files grep -- print lines matching a pattern man -- format and display the on-line manual pagesH]%U ls JApplications Library Pictures Desktop Movies Public Documents Music SitesK nK&$ls -aFlhdrwxr-xr-x 64 srussel2 srussel2 2K Jun 28 22:04 ./ drwxr-xr-t 4 root admin 136B Jul 7 2006 ../ -rw-r--r-- 1 srussel2 srussel2 21K Jul 10 20:11 .DS_Store drwx------ 4 srussel2 srussel2 136B Jul 10 20:34 .Trash/ -rw------- 1 srussel2 srussel2 11K Jul 9 20:21 .bash_history -rw-r--r-- 1 srussel2 srussel2 797B Jan 5 2007 .profile drwx------ 3 srussel2 srussel2 102B Jul 15 2006 .ssh/ -rw------- 1 srussel2 srussel2 6K Jun 28 20:59 .viminfo drwx------ 78 srussel2 srussel2 2K Apr 26 15:28 Applications/ drwx------ 26 srussel2 srussel2 884B Jun 20 19:13 Desktop/ drwx------ 92 srussel2 srussel2 3K Jul 10 20:44 Documents/ drwx------ 53 srussel2 srussel2 1K Jan 3 2006 Library/ drwx------ 12 srussel2 srussel2 408B Sep 6 2006 Movies/ drwx------ 11 srussel2 srussel2 374B Jan 7 2006 Music/ drwx------ 31 srussel2 srussel2 1K Jan 4 2007 Pictures/ drwx------ 7 srussel2 srussel2 238B Dec 20 2003 Public/ drwx------ 47 srussel2 srussel2 1K Aug 18 2006 Sites/ n* - - ,,.- 97, 3,3* 42 touch and mkdir [touch file.txt touch file{1,2,3}.txt mkdir ~/BASH\ Primer mkdir -p ~/Projects/BASH\ Primer\ n\,&  cp and mvCOPY cp old_script.sh ~/Applications/new_script.sh MOVE mv old_script.sh ~/Applications/new_script.sh RENAME mv old_script.sh new_script.sh n     grep vgrep <string to find> <file(s)> grep dscl ~/Applications/UNIX/*.sh adduser.sh: ASSIGNED=`dscl localhost -list /NetInfo/Users uid | grep $UNIQUE_ID` adduser-panther-new.sh: ASSIGNED=`dscl localhost -list /NetInfo/Users uid | grep $UNIQUE_ID` changeHome.sh: sudo dscl localhost -change /Users/$1 NFSHomeDirectory "$OLDHOME" "$NEWHOME adduser-panther-new.sh: dscl localhost create /users/$USERNAME grep ^\# ~/Applications/UNIX/*.shTF nZQ nZ% nZFQ%         man dsclNAME dscl -- Directory Service command line utility SYNOPSIS dscl [options] [datasource [command]] options: -p prompt for password -u user authenticate as user -P password authentication password -raw don't strip off prefix from DirectoryService API constants -url print record attribute values in URL-style encod- ing -q quiet - no interactive prompt n 3   *&man -k uuid apropos uuid6Imbr_uid_to_uuid(3), mbr_gid_to_uuid(3), mbr_uuid_to_id(3), mbr_sid_to_uuid(3), mbr_uuid_to_sid(3) - translate user and group identifiers from one form to another uuid(3) - DCE compatible Universally Unique Identifier library uuid_clear(3) - reset value of UUID variable to the NULL value uuid_compare(3) - compare whether two UUIDs are the same uuid_copy(3) - copy a UUID value uuid_generate(3), uuid_generate_random(3), uuid_generate_time(3) - create a new unique UUID value uuid_is_null(3) - compare the value of the UUID to the NULL value uuid_parse(3) - convert an input UUID string into binary representation uuid_unparse(3) - convert an UUID from binary representation to a string uuidgen(1) - command-line utility to generate a new UUID valueJ nJ CKE* ( 2FNEF Environment VariablesCprintenv = print out the environment HOME, USER PWD, OLDPWD PATH ; Configuring Your PromptPS1='\h:\w \u\$ ' Scott-Russells-iBook-G4:/etc srussel2$ \h = hostname to the first  . \w = present working directory \u = current user http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html* nZZrl   Handful of BASH Utilsbbman -- converts man pages to plain text and opens them in your favorite text editor smb.sh -- mount NetFile drives using mount_smbfs touchx -- creates a new executable with boilerplate text in a default folder and opens it for editing http://www.nd.edu/~srussel2/macintosh/bash/(Z, nZQ `   BASH ResourcesAdvanced BASH Scripting Guide http://tldp.org/LDP/abs/html/ PDF and HTML versions available AWK One-Liners http://unixnotes.wordpress.com/2006/03/15/awk-one-liners/ NDMAC Home Page http://www.nd.edu/~ndmac/Z>ZZ:ZZZ>:  1    ';?l/ 2 ` \ғy`Ӣ` cb^DD6&&`Y˵W` sg7IAxGr` K%ޯd{mG/` J*T3333` 3` QYmx~3ft` ff>>\..Fg̙` 33f>?" dd@,?nFd@    @ `  n?" dd@   @@``PR    @ ` `<p>> l,(  lT ~ l "~ l c BlCrDEF"d@ rlrl@`"~z\ { l "{ l c BB CDEFd @ bb   H   T W6Vw}\gFQ6<1++11 1L b6xQrq 6\}N   - c    0 A Q g     S    6N KawF bFy0 a*ly7lE;uz  B | a F 0 ! 1 < B < & l L 0  @`"T  l c |BC+DEFyd @ ==gL6cI}\eA& w6m!W<! &<W!r6W}F6\}>68QNlX^XH8+Sgg|@`"Jo 5  l c B! CDEF @ ))\*l{FDNF W% W ! !   ! 6X L b x_ /aF6b}SA$|l\\TX@`"T  u4 l B C%DEF ss&QW}k6D Q r 8 N c t y y ;t Qi gS }8     T   :0\-Q4*%%v*o(V}5q;  S   < s } l \ g} \, L ;n &  Z}\[6 }WF<! e C }h m W ]  ,t B RxkqA,Rg@`" {2  l c BCDEFy @ ,,Lh6\}mWG &a*zCxsh-&jG]~5g6&LLZ\@`" u(   l c BCDE|Fy @ __@% M|f4@{ f0`lA}L\A+h MB6ww FJl{ 0V|{J  *5KlGn a*:Pf\|6 /6Kbf|F kP}5x}VvaP@@@`" >   l 60|h " `}  T Click to edit Master title style! !$  l 0wh " `  RClick to edit Master text styles Second level Third level Fourth level Fifth level!     S  l 6vh #" `b `  b*0   l 6xh #" ``   d* 0   l 6th #" `` `  d* 0  B l s *޽h ? 3|___PPT10\. u%.+D0' 0=+  Stream1  UM p(  pT ~ p "~ p c BlCrDEF"d@ rlrl@`"~z\ { p "{ p c BB CDEFd @ bb   H   T W6Vw}\gFQ6<1++11 1L b6xQrq 6\}N   - c    0 A Q g     S    6N KawF bFy0 a*ly7lE;uz  B | a F 0 ! 1 < B < & l L 0  @`"T  p c |BC+DEFyd @ ==gL6cI}\eA& w6m!W<! &<W!r6W}F6\}>68QNlX^XH8+Sgg|@`"Jo 5  p c B! CDEF @ ))\*l{FDNF W% W ! !   ! 6X L b x_ /aF6b}SA$|l\\TX@`"T  u4 p B C%DEF ss&QW}k6D Q r 8 N c t y y ;t Qi gS }8     T   :0\-Q4*%%v*o(V}5q;  S   < s } l \ g} \, L ;n &  Z}\[6 }WF<! e C }h m W ]  ,t B RxkqA,Rg@`" {2  p c BCDEFy @ ,,Lh6\}mWG &a*zCxsh-&jG]~5g6&LLZ\@`" u(   p c BCDE|Fy @ __@% M|f4@{ f0`lA}L\A+h MB6ww FJl{ 0V|{J  *5KlGn a*:Pf\|6 /6Kbf|F kP}5x}VvaP@@@`" >   p <xh "F   T Click to edit Master title style! !  p 0uh " `    W#Click to edit Master subtitle style$ $  p 6h #" `` `  b*0   p 6h #" `b   d* 0   p 6h #" `d `  d* 0  B p s *޽h ? 3|___PPT10\. u%.+D0' 0=+ zr`| ( 00// | | 0f P    P*   | 0o     R*  d | c $ ?   | 0 o  @  RClick to edit Master text styles Second level Third level Fourth level Fifth level!     S | 6 @n `P   P*   | 6@Dn `   R*  H | 0޽h ? 33 @$(  r  S  ]n pF   r  S \n p `    H  0޽h ? 33  pt( .... tl t C Gn l `}   l t C `Hn l `  H t 0޽h ? 3  x(  xl x C  l `}   l x C @ l `  H x 0޽h ? 3  ( .... l  C  l `}   l  C  l `  H  0޽h ? 3  ( @ihi l  C  l `}   l  C  l `  H  0޽h ? 3  ( .... l  C  . l `}   l  C @. l `  H  0޽h ? 3  ( | l  C 0f l `}   l  C Ўf l `  H  0޽h ? 3  ( .... l  C Pf l `}   r  S f l `  H  0޽h ? 3  P( .... l  C vh l `}   l  C @. l `  H  0޽h ? 3  ( .... l  C f l `}   l  C f l `  H  0޽h ? 3  0( .... l  C Sl l `}   l  C `n l `  H  0޽h ? 3  ( .... l  C Бf l `}   l  C pf l `  H  0޽h ? 3  (  l  C Дf l `}   l  C pf l `  H  0޽h ? 3 NF(  R  3 |   L  C f| @   -a = Include directory entries whose names begin with a dot (.) -F = Display a slash after directories; an @ after each symbolic link; and an * after each executable file -l = long listing -h = show  KB ,  MB ,  GB , etc. for file sizesH  0޽h ? 33dxp^RЀ3ÿ lHbP  @AL G@;b `B&V:R e(-rX`/Noquisiwy{}yq k  ՜.+,D՜.+,    dOn-screen Show뿿뙰   Times PalatinoTimes New Roman WingdingsArialStreamBASH Shell PrimerBasic Shell Commandsls ls -aFlhtouch and mkdir Oh+'0/ hp   @ L Xdl'BASH Shell PrimerScott RussellPMac HD:Applications:Microsoft Office X:Templates:Presentations:Designs:StreamScott Russell19Microsoft PowerPoint@Z@x?S@p,G.PICT.z HH HH  aWXY[ \ ]!! _$$ `'' b**!c--!e00"f33#h77#j::$l>>$mAA%oEE&qHH&sLL'tOO'vSS(xWW(zZZ)|^^* }aa*!!dd+""gg+##kk,$$nn,%%qq-&&tt-''ww.((zz.))}}/**/++΁0,,΄0,,Ά0--Έ0--Ή1..΋1//΍1//Ύ200ΐ200Α200/021101P*)*)*21RE1QR11QR1@10101={ ZZм`GP Zм`]FLjLjKy]b21aŵ814x1x}1i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5Z{*l߸l3223)}ꏙɣ+#"+#싙ʹ͌$Νُʊ鍙󩕬Ν7.'.'&0 &0 3)  233)  )0/2/3# -3! /3"0/2/3 ')3*+0 3!    "3 *3$" 3$ " % 31*+0 3" 323)F! _ZP}(!{67L:4i .c1"67L:4]'w| Pw96ZcBfb.~$g]m^go) S 3w96Zg]L3.(*13.(*132*(032*(0313ҙy~y~xϙx3313֙3313֙3313ՙ33213֙33223י3323ؙ3323ڙ33123ܙ33123#332123'332123+332212231332123211;33322120101232110B321101232212010N32212010123221100/01I31011223200/01223I320/012232/./01223E3210//012232/../0123c33320//0012232/../012333333331/32./0123 333333333333//23/../0123333333133/023 3 33333333/33/3 ߙ33333333333/3ޙm3333333333333333331/3ޙ&3201320023ݙߙ,32001323203ߙ.31002323213$320012323ԙ)3211012323ؙ,32112232323ܙ)32321123ߙ132/0232123:320./02321001223132322101223633232210/022323321231/023j33333333212320/13™333333311320//..13333331/231.23 33 33333..31.3 33333333..131.23™c333333331.3.3=333331.3.3ߙ1331.3.23210:332/.131./2320.333333333332/.131/2321.͙33333333320/.132320.͙3333333./2321/.͙33333333/./12321/./023͙Ɓ333333333../123220.0123͙33333333 221100/../0123210/./0123̙ X3333200/./012321/./0123C3220/0011321./0123E321100/00123221/0223Á333333333322100/1233321/0023ՙ3333330033/0223ՙ$ 3 333302/0023ՙ ݙ 3 3333330233301223ՙ ڙƁ33 3333313333323ՙ י3333333321333000123ԙԙ7321310123ҙ6321321223ϙ83212321223͙332112322123ʙ+3232213ƙ(32323ę)3232323™#32323™%32323Ù#3232323ř32323ƙ32323ə32323ʙ cp and mvgrep man dsclman -k uuid apropos uuidEnvironment VariablesConfiguring Your PromptHandful of BASH UtilsBASH Resources  Fonts UsedDesign Template Slide Titles $ 8@ _PID_HLINKSA,http://www.nd.edu/~srussel2/macintosh/bash/http://tldp.org/LDP/abs/html/:http://unixnotes.wordpress.com/2006/03/15/awk-one-liners/http://www.nd.edu/~ndmac/Lhttp://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html%_ˍ Scott RussellCurrent User-