Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Linuxtools fuer Developer

4,162 views

Published on

Martin Brotzeller erklärt Tools und Features der Shell, mit denen Programmierer sich das Leben einfacher machen können. Der Schwerpunkt liegt beim Arbeiten mit der History sowie gängigen Tools.

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Linuxtools fuer Developer

  1. 1. Linuxtools für DeveloperMartin Brotzeller I 28.07.2011 © Mayflower GmbH 2011
  2. 2. RTFM Mayflower GmbH I 2
  3. 3. Bash - UmleitungenUmleitungen und Datenfluss bei Verknüpfungen > leitet die Ausgabe in eine Datei um < holt die Eingabe aus einer Datei | leite die Ausgabe an ein weiteres Kommando >> hängt die Ausgabe an eine Datei an << ermöglicht Eingabe über ein Here-Dokument wie in PHP 2> leitet die Fehlerausgabe um 2>&1 leitet die Fehlerausgabe in die Standardausgabe ( ) kapselt eine Subshell ` ` (Backticks) kapseln einen Befehl dessen Ausgabe direkt als Kom- mandozeilenargument verwendet wird Mayflower GmbH I 3
  4. 4. Beispiele: Umleitungen Beispiele zu Umleitungen ls | wc -l Zählt die Dateien im aktuellen Verzeichnis find 2>&1 | grep „.php“ > phpfiles.txt Leitet die Fehler- und Standardausgabe weiter an grep. Der ganze Befehl erstellt eine Liste von PHP-Dateien (ja, das geht auch einfacher) Mayflower GmbH I 4
  5. 5. Bash - HistoryDie History kann auf verschiedene Weise bedient werden. Am schnellsten geht das mit dem Expansionssymbol (normalerweise !)I !$ wird zum letzten Argument des vorigen BefehlsI !! wiederholt das letzte Kommando (kombinierbar)I !? sucht nach einem String in der HistoryI ^string1^string2^ ersetzt string1 mit string2 im vorhergehenden KommandoI :p am Ende des Kommandos verhindert AusführungI :gs/string1/string2/ ersetzt string1 mit string2, aus beliebigem Historyeintrag Mayflower GmbH I 5
  6. 6. Beispiele: Historyvi config.phpsvn diff !$^diff^committar tzvf datei.tgz^tz^xz Mayflower GmbH I 6
  7. 7. Beispiele: History IIcp /www/htdocs1/datei1.php /www/htdocs2/datei1-foo.php!!:gs/datei1/datei2/!!:gs/datei2/datei3/Drei Dateien nach dem selben Muster kopieren Mayflower GmbH I 7
  8. 8. ToolsI wc Zählt Zeichen, Wörter und Zeilen. Mit -l werden nur Zeilen gezähltI fmt Formatiert (Plain-)Texte – Zeilenumbrüche, Absätze, etcI cat / tac Ausgabe von Dateien vorwärts und rückwärtsI ps Zeigt Prozesse an. Mit Optionen axuw erwischt man alle Prozesse Mayflower GmbH I 8
  9. 9. Tools III head / tail Anzeige von Beginn oder Ende einer Datei, -f bei tail fortlaufendI cut Spaltenweise Ausfiltern der Eingabe anhand von einem Trennzeichen cut -d “:” -f 1 /etc/passwd Zeigt alle (lokalen) Nutzername des Systems anI xargs Übergibt Eingabe als Reihe von Parametern an ein Kommando find -name ”*php“ | xargs grep ”require“ grept nach „require“ in allen PHP-Dateien Mayflower GmbH I 9
  10. 10. Tools IIII sort sortiert zeilenweiseI uniq entfernt doppelte aufeinanderfolgende ZeilenI bc Kommandozeilen-TaschenrechnerI od Oktal/Hexadezimaler DumpI seq Erzeugt Reihe von Zahlen Mayflower GmbH I 10
  11. 11. Grepgrep steht kurz für “Global Regular Expression Parser“ - Suche nach Eingabemustern die auf reguläre Ausdrücke passen. Statt der Standardeingabe kann auch eine Liste von Dateien übergeben werdenI Nützliche Optionen · -i (case insensitive) · -l (nur Dateiname zeigen) · -c (count) · -r (rekursiv) · -A/-B-/C <num> Anzahl Zeilen Kontext · -E “extended“ ermöglicht Alternativen Mayflower GmbH I 11
  12. 12. Beispiele: GrepI ps uxaw | grep “http“ | grep -v “grep” finde alle Prozesse mit “http” im PfadI find -type d | grep -v “.svn” finde Verzeichnisse die nicht “.svn“ im Pfad enthaltenI grep -E “(include|require)“ *.php suche alle Zeilen mit include oder require in den PHP-Dateien des aktuellen Verzeichnis Mayflower GmbH I 12
  13. 13. FindFinden von Dateien zur Weitergabe an andere ToolsI find /www/ -name “*.php“ Zeigt alle PHP-Dateien unterhalb von /www an (-iname für case insensitive Suche)I find /www/ -type d ( -name CVS -o -name SVN ) -exec safe-rm -r {} ; sucht alle Verzeichnisse namens CVS oder SVN und löscht diese Mayflower GmbH I 13
  14. 14. Beispiele: FindI find . -newer <Dateiname> -print Zeigt alle Dateien, die editiert wurden, nachdem Dateiname zum letzten mal editiert wurdeI find -name “*.sql“ | xargs rm Sucht alle Dateien die auf .sql enden und übergibt sie an rm als Kommandozeilenargument Mayflower GmbH I 14
  15. 15. SedI Mächtiges Werkzeug zur TextmanipulationI Agiert zeilenweiseI Versteht Reguläre AusdrückeI sed -e s/foo/bar/ datei.txt Ersetzt in der Datei auf jeder Zeile jeweils das erste foo mit bar und gibt das Ergebnis aus. Mayflower GmbH I 15
  16. 16. Beispiele: SedEs geht auch komplizierter:sed -e s/</n</g *.html | grep ^<a | sed -e s/.*href=“([^“]*)“.*/1/ grep -v ^<a(...und das ist noch nicht das Ende der Fahnenstange) Mayflower GmbH I 16
  17. 17. AWKI „AhWehKah“ (Aho-Weinberger-Kernighan)I Stream-basiertI Beginnt, wo Sed nicht mehr ausreichtI Jede Regel hat ein MusterI Pro Zeile wird die Regel ausgeführt, deren Muster passt Mayflower GmbH I 17
  18. 18. Beispiele: AWKI ls -l | awk {print $6 “ “ $7 “ “ $8 “ “ $9 “ “ $5} Besseres „cut“, hier wird unabhängig von der Anzahl der Leerzeichen immer die selbe Spalte ausgegeben – konkret hier Datum, Uhrzeit, Dateiname und danach DateigrösseI awk BEGIN{ printf(“%in“,0x37ab); } Einfach nur mal 0x37ab in dezimal ausgeben Mayflower GmbH I 18
  19. 19. Beispiele: AWK III ls -l | awk BEGIN{ x=0; } { x+=$5; } END{ printf(„x is %sn“,x); } Zusammenzählen der Dateigrössen im aktuellen Verzeichnis Mayflower GmbH I 19
  20. 20. ViI Überall verfügbarI Schnelles, ressourcenschonendes EditierenI Mächtige Kommandos für Textersetzungen Mayflower GmbH I 20
  21. 21. ScreenI „Container“ für ShellsI Session nicht an Verbindung geknüpftI Schnelles wechseln von TasksI Arbeiten auf mehreren RechnernI Teilen des sichtbaren Bereichs Mayflower GmbH I 21
  22. 22. Vielen Dank für Ihre Aufmerksamkeit! Referent Martin Brotzeller martin.brotzeller@mayflower.de +49 931 35965 16 Mayflower GmbH Pleichertorstr. 2 97070 Würzburg29.07.2011 Mayflower GmbH 22
  23. 23. BeispielFragen? Mayflower GmbH I 23

×