Linux Tutorial

Reviews
Shared by: lili herlina
Stats
views:
61
rating:
not rated
reviews:
0
posted:
11/5/2009
language:
English
pages:
0
Linux Tutorial ACM @ UB Dave Fine & Dave Cadigan Written by Linus Torvalds in 1991 Heavily influenced by Unix and MINIX ◦ MINIX was written from scratch by Torvald's professor,  Andrew Tanenbaum, at the University of Helsinki. Licensed under the GNU General Public License History Original source code is available to the public  for use or modification as they see fit Open examples ◦ .ogg ◦ OpenOffice.org ◦ phpBB (forums) ◦ GNU ◦ Mozilla Closed examples What is Open Source? ◦ .mp3 ◦ Microsoft Office ◦ Proprietary drivers Stable Bleeding Edge Specialized ◦ Slackware ◦ Redhat ◦ Ubuntu ◦ Fedora Core ◦ Damn Small Linux ◦ UBLinux More at distrowatch.com Choosing a Distro Live Disks ◦ Ubuntu, Fedora Core, Knoppix Hard Drive setup ◦ Many file systems to choose from ‑ ext2/3, ReiserFS ◦ Must allocate swap space (virtual memory) Dual Boot Windows NTFS 70GB Linux ext3 28GB 100 GB Swap 2GB ◦ Install Windows first!! How to Install GNOME KDE XFCE many more Desktop Managers Shells bash tcsh ◦ Use text commands to interact with files ◦ Everything is case sensitive ◦ White­space sensitive ◦ Most commonly used ◦ used on ubunix The Command Line Package managers Manual installations Build from source ◦ Aptitude ◦ YUM ◦ Automatically resolves dependencies! ◦ .deb ◦ .rpm ◦ $ tar –xvzf ◦ $ ./configure ◦ $ make ◦ $ sudo make install How to install software Owner, Groups, Others Read, Write, Execute chmod  ◦  4         2          1 Root user Sudo ◦ chmod 755 filename.txt ◦ chmod u+rwx,o­w filename.txt ◦ Similar to Windows Administrator ◦ $ sudo emacs xorg.conf Permissions Man pages ◦ man emacs Strong online community ◦ forums ◦ irc channels ◦ newsgroups UB ◦ ublinux­support@buffalo.edu More Support Good for: ◦ System admins ◦ Quick and dirty prototyping for a complex application ◦ Easy way to write custom automated tasks Bash Scripting #!/bin/bash #one line comment #make a variable var=“how are you?” echo “hello $USER $var” echo “a”; echo “b”;  var=1  #legal, variables are untyped exit 0     #exit code Basics X=2 if [ $X ­eq 1 ]  then echo “1” elif [ $X ­eq 2 ] then echo “2” else echo “none” 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 "confirm delete all files in directory?" read choice case $choice in   "yes")     rm *     ;;   "no")     echo "nothing removed"     ;;   *)     echo "Please choose either yes or no"     ;; esac  Switch Cases n=1 while [ $n ­le 10 ] do   echo $n   ((n++)) done for n in `seq 0 10` do   echo $n done for X in red green blue #no C style loops: do  for(int i =0;i<10;i++) echo $X done Loops array_1[5]=”c” array_2=(1 2 3 4 5) echo ${array_2[2]}     # outputs “3” array_3=”abcdefg”   #strings are arrays # note that arrays start counting at 0! Arrays function a(){ echo $1 #special variable. first argument return 2; #optional return statement } #last statement in {} needs a semi­colon a hello #outputs “hello” echo $?   #outputs 2 Functions  Piping ◦ ps aux | grep firefox­bin       #is firefox running?  Redirection ◦ ./script.sh > file.txt              #print output from a script to a file ◦ echo “some text >> file.txt       #append to a file  History ◦ !em  Math     #execute the latest command that started with “em” ◦ echo $((1+1))                          #outputs 2 Other Features http://www.faqs.org/docs/bashman/bashref_toc.html# http://www.bit­tech.net/bits/2007/11/26/bashing_throu http://www.panix.com/~elflord/unix/bash­tute.html man bash citations

Related docs
Linux tutorial
Views: 110  |  Downloads: 24
Linux Tutorial PDF
Views: 4124  |  Downloads: 415
Linux Virtual Server Tutorial
Views: 226  |  Downloads: 14
Linux Tutorial
Views: 425  |  Downloads: 126
Tutorial linux
Views: 293  |  Downloads: 35
Beginner Linux Tutorial
Views: 519  |  Downloads: 113
Linux Tutorial
Views: 600  |  Downloads: 72
Pajek for linux tutorial
Views: 73  |  Downloads: 4
linux kernel tutorial
Views: 182  |  Downloads: 18
Linux_Tutorial
Views: 43  |  Downloads: 2
premium docs
Other docs by lili herlina
Killer Adsense Report
Views: 194  |  Downloads: 0
Belkin Manual Wireless Network
Views: 342  |  Downloads: 2
Visual Basic Tutorial
Views: 138  |  Downloads: 2
Mastering Ajax Part 1
Views: 8  |  Downloads: 0