Sie sind auf Seite 1von 22

LinuxTutorial

ACM@UB DaveFine&DaveCadigan

WrittenbyLinusTorvaldsin1991 HeavilyinfluencedbyUnixandMINIX

MINIXwaswrittenfromscratchbyTorvald'sprofessor, AndrewTanenbaum,attheUniversityofHelsinki.
LicensedundertheGNUGeneralPublicLicense

History

Originalsourcecodeisavailabletothepublic

foruseormodificationastheyseefit Openexamples
.ogg OpenOffice.org phpBB(forums) GNU Mozilla

Closedexamples

WhatisOpenSource?

.mp3 MicrosoftOffice Proprietarydrivers

Stable

BleedingEdge Specialized

Slackware Redhat

Ubuntu FedoraCore

DamnSmallLinux UBLinux

Moreatdistrowatch.com

ChoosingaDistro

LiveDisks

Ubuntu,FedoraCore,Knoppix
HardDrivesetup

Manyfilesystemstochoosefrom
ext2/3, ReiserFS

Must allocate swap space (virtual memory)


Dual

Boot
Windows NTFS 70GB Linux ext3 28GB 100GB Swap 2GB

Install Windows first!!

HowtoInstall

GNOME KDE XFCE manymore

DesktopManagers

Shells

bash tcsh

Usetextcommandstointeractwithfiles Everythingiscasesensitive Whitespacesensitive Mostcommonlyused usedonubunix

TheCommandLine

Packagemanagers

Manualinstallations Buildfromsource

Aptitude YUM Automaticallyresolvesdependencies! .deb .rpm

$tarxvzf $./configure $make $sudomakeinstall

Howtoinstallsoftware

Owner,Groups,Others Read,Write,Execute chmod

421

Rootuser Sudo

chmod755filename.txt chmodu+rwx,owfilename.txt SimilartoWindowsAdministrator $sudoemacsxorg.conf

Permissions

Manpages

manemacs
Strongonlinecommunity

forums ircchannels newsgroups


UB

ublinuxsupport@buffalo.edu

MoreSupport

Goodfor:

Systemadmins Quickanddirtyprototypingforacomplexapplication Easywaytowritecustomautomatedtasks

BashScripting

#!/bin/bash #onelinecomment #makeavariable var=howareyou? echohello$USER$var echoa;echob; var=1 #legal,variablesareuntyped exit0#exitcode

Basics

X=2 if[$Xeq1] then echo1 elif[$Xeq2] then echo2 else echonone fi

-eq #equal -ne #not equal -lt #less than -le #less than or equal -gt #greater than -ge #greater than or equal string1 == string2 string1 != string2 string1 > string2 -a file # true if file exists more at LINK

Conditionals

echo"confirmdeleteallfilesindirectory?" readchoice case$choicein "yes") rm* ;; "no") echo"nothingremoved" ;; *) echo"Pleasechooseeitheryesorno" ;; esac

SwitchCases

n=1 while[$nle10] do echo$n ((n++)) done

fornin`seq010` do echo$n done

forXinredgreenblue #noCstyleloops: do for(inti=0;i<10;i++) echo$X done

Loops

array_1[5]=c array_2=(12345) echo${array_2[2]}#outputs3 array_3=abcdefg#stringsarearrays

#notethatarraysstartcountingat0!

Arrays

functiona(){ echo$1 #specialvariable.firstargument return2;#optionalreturnstatement } #laststatementin{}needsasemicolon

ahello #outputshello echo$?#outputs2

Functions

Piping

psaux|grepfirefoxbin#isfirefoxrunning?
Redirection

./script.sh>file.txt#printoutputfromascripttoafile echosometext>>file.txt#appendtoafile
History

!em
Math

#executethelatestcommandthatstartedwithem

echo$((1+1))#outputs2

OtherFeatures

http://www.faqs.org/docs/bashman/bashref_toc.html#

http://www.bittech.net/bits/2007/11/26/bashing_throu http://www.panix.com/~elflord/unix/bashtute.html manbash

citations

Das könnte Ihnen auch gefallen