Top Banner
LINUX A UMass Amherst M5 workshop Sean Klaiber November 2011 1
34

Linux

Feb 26, 2016

Download

Documents

aira

Linux. A UMass Amherst M5 workshop Sean Klaiber. General information. Why Use Linux?. Save Money Initial purchase and maintenance Resume Linux is used by MANY organizations More choices Tons of Linux operating systems. What is Linux?. Contains the Linux kernel - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Linux

1

LINUXA UMass Amherst M5 workshopSean Klaiber

November 2011

Page 2: Linux

2

GENERAL INFORMATION

November 2011

Page 3: Linux

3

Why Use Linux?• Save Money

• Initial purchase and maintenance

• Resume• Linux is used by MANY organizations

• More choices• Tons of Linux operating systems

November 2011

Page 4: Linux

4

What is Linux?1. Contains the Linux kernel

• The kernel is the low-level software that manages hardware, multi-tasks programs, etc.

2. Linux Operating System• Includes the kernel• Also various utilities to get things done (program to copy files, etc)

3. Linux Distributions• Software companies will sell extra software

• E.g. the desktop environment, games, etc.• Ubuntu is one of many Linux distributions

November 2011

Page 5: Linux

5

LicensingThe GNU General Public License

Linux is under

This means that Linux can be:1. Freely copied, changed, and distributed2. No distribution restrictions can exist 3. The source code must be made available to the

public

November 2011

Page 6: Linux

6

How Can It Be Free?• Linux developers make money by:

1. Custom applications for large companies2. Tech support3. Other jobs that don’t involve Linux

Linux (and the Open Source movement as a whole) is an example of how the highest

quality results come from those who do work of their own free will

November 2011

Page 7: Linux

7

Ubuntu

• Just one of many distributions or “distros” of Linux• Oneiric Ocelot is version 11.10

• Released October 2011• Developed by Canonical Ltd.

• About 500 paid workers and thousands of volunteers• Features:

• Unity Desktop Environment• LibreOffice suite• Ubuntu Software Center

November 2011

Page 8: Linux

8

LibreOffice• Fork of OpenOffice

• Development began January 2011

• Oracle purchased Sun Microsystems in Jan 2010

• Sun owned OpenOffice and developers didn’t trust

that Oracle would continue development• Discontinued development on Sun’s OpenSolaris operating

system

November 2011

Page 9: Linux

9

Package Management

• Maintains a database of software dependencies & version info• Prevents software redundancies• Automatically organizes software

• Ian Murdoch has called it “the single biggest advancement Linux has brought to the industry”

• Ubuntu uses the “Ubuntu Software Center”• Can browse, download, and remove software

November 2011

Page 10: Linux

10

Common Problems with Linux• Cannot develop or pre-install proprietary drivers• Doesn’t always work fluidly with all hardware

• E.g. Mac touchpads

• Cannot run many proprietary software packages• Larger learning curve

November 2011

Page 11: Linux

11

QUESTIONS SO FAR?

November 2011

Page 12: Linux

12

BOOT TIME

November 2011

Page 13: Linux

13

Boot Time• Hold ‘c’ while turning on a Mac to boot from the disk drive

• Will probably need to install Wireless Card drivers• Top right hand corner• There should be a pop-up announcement

• Turn on two-finger scrolling (Macs)• System Preferences• Very top right

November 2011

Page 14: Linux

14

THE COMMAND LINE

November 2011

Page 15: Linux

15

Why Use The Command Line?

A relatively simple string of text provides direct

and unambiguous access to complicated

tools

November 2011

Page 16: Linux

16

POSIX

• As set of standards that Unix-y (including Linux) operating systems follow to provide portability

• Most basic command line tools are POSIX compliant

• Means that code written with Ubuntu can be easily run with Mac OSX or Debian or Gentoo or Damn Small Linux…

… but not Windows

Portable Operating System Interface for UniX

November 2011

Page 17: Linux

17OPEN THE TERMINAL

Useful Commandscd => change directoryls => list directory contentscp => copy files/directoriescat => concatenate and print filesecho => print textmkdir => make directoriespwd => prints working directoryman => open manual pagesless => read file with scrollingfind => search for filesdate => print / modify date

November 2011

Page 18: Linux

18

TASK #1Navigate, Create, Destroy

November 2011

Page 19: Linux

19

Navigation/ => root directory~ => home directory (also

‘/home/<user>/’).. => directory one level up. => current directory

• ‘cd’ allows movement between directories• Syntax: ‘cd PATH_NAME’• PATH_NAME can be any of the symbols above, a directory

name, or some combination for complex movement• ‘pwd’ will print the current directory in case you get lost

November 2011

Page 20: Linux

20

Task #1: Navigate, Create, Destroy1. Using the ‘cd’ command, navigate to the

Desktop• Hints: The ‘ls’ command will help you find the Desktop

2. Create a directory in the Desktop using ‘mkdir NAME’

• NAME can be anything you desire3. Navigate into this new directory4. Create a file and fill it with junk

• Use command ‘echo JUNK > FILE_NAME’5. Read the contents with ‘cat FILE_NAME’6. Read the contents with ‘less FILE_NAME’

• Exit ‘less’ by hitting ‘q’7. Remove the file with ‘rm FILE_NAME’

November 2011

Page 21: Linux

21

Standard Files• Standard Output is printed to the computer screen

• ‘>’ will overwrite a file with a functions standard output• ‘>>’ will append the standard output to the end of a file

• Standard Input is by default what we type on the keyboard• Use ‘<‘ to take input from a file

• Standard Error is an alternative type of output for errors• Use ‘2>’ to overwrite a file with standard error

November 2011

Page 22: Linux

22

Try…$ cd ~$ ls Desk > FILE_NAME$ cat FILE_NAME$ ls Desk 2> FILE_NAME$ cat FILE_NAME

Note that the standard error is not only being written to the FILE_NAME but is being redirected

from the terminal to FILE_NAME

November 2011

Page 23: Linux

23

Input Arguments• Try deleting the directory with the ‘rm’ command. Tricky?

Command line tools often use input arguments to extend their

functionality

• Delete the directory with ‘rm –r DIRECTORY_NAME’• ‘-r’ stands for ‘recursive’ and will delete any file in the

directory

November 2011

Page 24: Linux

24

Save Time• Hit the button at any point to recall the last command

• ‘tab’ will fill in the remaining characters for file and directory names if there is only one possible option

Use and tab often

November 2011

Page 25: Linux

25

TASK #2Process Handling

November 2011

Page 26: Linux

26

What’s a Process?• A process is a program in action• Programs in executable form reside

on disk, when run, they are moved into memory and become a process

• Linux assigns each process a Process Identification or PID

November 2011

Page 27: Linux

27

Task #2: Process Handling$ gbrainy‘ctrl-c’ to kill$ gbrainy &$ ps$ baobab &$ ps$ kill <PID>$ history

(do in new terminal)$ ps$ ps aux | grep gbrainy$ top$ tty

November 2011

Page 28: Linux

28

Nano Text EditorNano is one of the simplest command line text

editors

• To create a file, save it, and exit nano:$ nano FILEBWONGG wubwubwubwub <- enter textctrl-o <- command to savectrl-x <- command to exit nano

November 2011

Page 29: Linux

29

Piping• Symbol is the vertical line, ‘|’

• Found at ‘shift+backslash’

• Takes standard output left of pipe and uses it as standard input to the function on the right of the pipe

November 2011

Page 30: Linux

30

Piping Hot Example• Create a file with a whole bunch of random words OR random text• Make it so each SET of words or numbers have their own

line

• While in that directory:$ sort FILE

- if using numbers, ‘sort –g’$ sort FILE | grep ITEM$ sort FILE | grep ITEM | uniq$ sort FILE | grep ITEM | uniq -c

November 2011

Page 31: Linux

31

TASK #3Bach and Forth Between Audio Formats

November 2011

Page 32: Linux

32

APT Package Manager• The Advanced Packaging Tool is what Ubuntu Software Center is built on

• ‘apt-get install PACKAGE’ will install and organize software

• ‘apt-cache list PACKAGE’ will search for PACKAGE in the local database

• ‘apt-get update’ update the local package database

November 2011

Page 33: Linux

33

FFMpegFFMpeg is a multimedia transcoder• Command line tools to convert sample rates, bit rates, file types, cut, copy, stream, and filter almost any audio, video, or image file

• We’ll convert a lossless .flac file to an .mp3 for iTunes

$ sudo apt-get install ffmpeg$ cd DIRECTORY_OF_FLAC_FILE$ ffmpeg –i FILE.flac NEW_FILE.mp3$ man ffmpeg

November 2011

Page 34: Linux

34

WASN’T THAT EASY?

November 2011