1 / 21

Lecture 1: Introduction, Basic UNIX

Lecture 1: Introduction, Basic UNIX. Advanced Programming Techniques. Why are we here?. What’s a computer Why do we run programs? What is needed to create a program?. Applications. Shell . Kernel (OS). Hardware. Structure of a typical OS. There are many standard applications:

samira
Download Presentation

Lecture 1: Introduction, Basic UNIX

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. Lecture 1: Introduction, Basic UNIX Advanced Programming Techniques

  2. Why are we here? What’s a computer Why do we run programs? What is needed to create a program?

  3. Applications Shell \ Kernel (OS) Hardware Structure of a typical OS There are many standard applications: • file system commands • text editors • compilers • text processing

  4. Connecting • Create Acct • www.cs.drexel.edu/Account.php • Cluster • PuTTY/SSH • Log in • Password

  5. Looking Around • Home directory • Startup and customization files • public_html • Files/dirs • cd, pwd, ls • Filesystem • Absolutle • Relative

  6. Commands for Files Looking around ls, pwd, cd, pushd, popd Files/dirs rm, cp, mv, mkdir, rmdir, ln Viewing cat, less (more), od, w3m, pdftotext, antiword Comparing diff, cmp

  7. Commands for Archiving • tar – Tape Archive • makes a large file from many files • Compression gzip, gunzip, bzip, compress

  8. File Permissions • Three types: • read abbreviated r • write abbreviated w • execute abbreviated x • There are 3 sets of permission: • user • group • other (the world, everybody else)

  9. ls -l and permissions -rwxrwxrwx UserGroup Others Type of file: - –plain file d –directory s – symbolic link

  10. Bourne-again Shell (bash) • Shells • Startup • Types • Alias, shell builtin, disk utility (program) • Syntax • Options, args

  11. man Pages man info

  12. Some commands man, info date, cal who,finger du, df, quota

  13. Basic control codes • Ctrl-D (^D) • set ignoreeof • Ctrl-C (^C) • Ctrl-U (^U) • Ctrl-Z (^Z) • Ctrl-L (^L)

  14. Shell metacharacters • Some characters have special meaning to the shell: • I/O redirection < > | • wildcards * ? [ ] • others & ; $ ! \ ( ) space tab newline • These must be escaped or quoted to inhibit special behavior

  15. Shell Variables • Values • Assignment • Reading • Common ones: • PATH, PS1, HOME, USER, HOSTNAME, PWD

  16. Shell options set built-in noclobber, ignoreeof, vi, -n Alias, hashing

  17. I/O 3 (4) files – stdin, stdout, stderr, stdlog Redirection Pipes

  18. filters • Unix philosophy • Everything's a file • Text processing • Some common filters… • wc, tr, grep, sort, cut, awk, uniq, head, tail, wc

  19. Quoting Escape char Strong quoting Weak quoting

  20. Processes, Subshells • ps,pid, ppid • Exported variables • Background processes, &, ctrl-Z • jobs, kill

  21. Editors • A text editor is used to create and modify text files. • The most commonly used editors in the Unix community: • vi (vim on Linux) • $ vimtutor • emac • $ emacs • Then, hit ctrl-h t (that’s control-h, followed by ‘t’) • You must learn at least one of these editors

More Related