1 / 40

CIT 500: IT Fundamentals

CIT 500: IT Fundamentals. Hardware and Shells. Topics. Computer hardware CPU Memory Storage Shells Types of Shells Globbing Command History Command Line Editing I/O Redirection. Hardware to Provide Four Functions. The Boot Process.

Download Presentation

CIT 500: IT Fundamentals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CIT 500: IT Fundamentals Hardware and Shells

  2. Topics • Computer hardware • CPU • Memory • Storage • Shells • Types of Shells • Globbing • Command History • Command Line Editing • I/O Redirection

  3. Hardware to Provide Four Functions

  4. The Boot Process The Basic Input/Output System (BIOS) setup program loads and runs. The Power-On-Self-Test (POST) runs. Bootloader runs. Operating system loads. OS starts user programs.

  5. Computer System Hardware

  6. Motherboard Layout Floppy Drive Connector IDE Connectors Main ATX Power Connector SATA Hard Drive Connectors Memory (RAM) Sockets PCI Expansion Card Slots CPU Socket Rear I/O Panel

  7. The Processor Aspects of performance • Clock speed (GHz.) • Instructions/clock cycle. • Number of cores. Architectures • IBM Power 5 • Intel Core 2 • AMD Athlon64

  8. Processor Operation • Fetch instruction from RAM. • Decode instruction. • Translate instruction to micro ops. • Determine what data is operated on. • Execute instruction.

  9. Inside a Processor Athlon block diagram from Anandtech.com.

  10. System Memory (RAM) • Volatile, loses its contents when the power is turned off. • All program instructions must be loaded into RAM before execution. • Performance • Access time: time to first read is ~25ns. • Throughput: DDR3-1333 SDRAM is 8.53 GB/s.

  11. Memory Hierarchy

  12. Hard Disks Non-volatile magnetic storage. Capacities range from 80GB – 2 TB. Latency: ~8ms, Throughput: ~100 MB/s. Interfaces Parallel ATA (PATA) 133 MB/s Up to 2 HDs, ribbon cable. Serial ATA (SATA) 300 MB/s Up to 128 HDs, serial cable. SCSI: high end servers 400 MB/s Flexible interface for servers.

  13. Hard Drive Components Enclosure Data Platters Read/Write Heads 40-Pin IDE Connector Jumpers Molex Power Connector

  14. Hard Drive Form Factors 1 inch – Made to fit in a Compact Flash Card slot 1.8 inch – UltraLight Notebook PC’s, MP3 Players, Digital Video Cameras 2.5 inch – Notebook PC’s 3.5 inch – Desktop PC’s

  15. SATA vs PATA

  16. Optical Storage Non-volatile optical storage Read-only, write-once, and read-write types. Double layer can double storage capacity. Slow: ~ 5 MB/s for CDs. Storage types CD (650 MB) DVD (4.7 GB) Blue Ray (25 GB)

  17. Solid State Storage Solid State Drive • Battery-backed up DRAM or • Flash memory + DRAM cache. • Latency: ~25µs, Throughput: ~250 MB/s • No moving parts much higher reliability. USB Flash Drive • Small flash memory with USB interface. • Slow: ~20 MB/s

  18. Case Form Factors

  19. Factors in Choosing a Case Form Factors Rack-mount server Desktop Mid-Size Tower Full-Size Tower Little, Teeny, Tiny Cases (VSFF) External and Internal Drive Bays Front (Top) Panel Multi-Media Connectors Cooling System (can also add-on)

  20. What is a shell? A command interpreter. • Runs external commands like cp and rm. • Built-in commands change shell environment: • cd – change directory • VAR=value • I/O redirection. • cat /etc/shells >shells • Ease of use • Command line editing, tab completion, history. • Programming • Conditionals, loops, etc.

  21. Which Shell Suits Your Needs?

  22. How to change your shell? Change your login shell permanently. > chsh zsh Run another shell directly > echo $SHELL /bin/bash > zsh %

  23. Environment Variables

  24. Shell Initialization Files Configure shell settings at login. • Create aliases. • Set environment variables. bash initialization files /etc/bash.bashrc System-wide startup file. ~/.bashrc User startup file.

  25. Shell Metacharacters • Non-alphanumeric characters that have special meaning to the shell. • They cannot be used in shell commands. • Allow you to specify multiple files in multiple directories in one command line.

  26. Globbing, a/k/a Wildcards ?  Matches any one character. *  Matches zero or more characters. []  Matches list of characters inside brackets.

  27. Globbing > ls *html announce.html guidelines.html readings.html sites.html assignments.html index.html schedule.html > cd assignments > ls a[2-3]?html a2.html a3.html

  28. Command History Up-arrow Previous command Down-arrow Next command history List old commands !! Previous command !# Command # !$ Last arg of previous command

  29. Command line editing Ctrl-a Beginning of line Ctrl-e End of line Left-arrow Move back one character Right-arrow Move forward one character Ctrl-u Erase line Ctrl-c Abandon current line without executing any commands.

  30. Filename completion TAB Completes filename TAB-TAB Show list of possible completions.

  31. Aliases Creates a name for command + options. alias=command string Need quotes if there are spaces in command string. Examples alias copy=cp alias ll=“ls –al” alias cb=‘’cat ~/.bashrc”

  32. Standard I/O STDIN • Default source of input. • Keyboard. STDOUT • Default output destination. • Screen. STDERR • Default error output destination. • Screen.

  33. I/O Redirection Redirecting output command > outfile command >> outfile Redirecting input command < infile Redirecting error command 2> outfile Redirecting all at once command < infile > outfile 2> errorfile

  34. I/O Redirection Examples Redirecting output ls –lR > /tmp/ls-lR man bash > bash-manual cat /etc/shells /etc/hosts > hosts-and-shells Redirecting input mail waldenj@nku.edu <assignment.txt Redirecting errors find / -name foo.txt 2>/dev/null

  35. Piping Redirecting I/O from a program instead of a file. command1 | command2 Equivalent to command1 > /tmp/file command2 < /tmp/file rm /tmp/file

  36. Pipe Examples Print the bash man page man bash | lpr Sort the list of files found in /etc ls /etc | sort Count the number of files in /etc ls /etc | wc –l Mail sorted list of files in /etc ls /etc | sort | mail waldenj@nku.edu

  37. References • Syed Mansoor Sarwar, Robert Koretsky, Syed Ageel Sarwar, UNIX: The Textbook, 2nd edition, Addison-Wesley, 2004. • Lee Weiner, CIT 141 notes, 2009. • Nicholas Wells, The Complete Guide to Linux System Administration, Thomson Course Technology, 2005.

More Related