1 / 17

CSC 140: Introduction to IT

CSC 140: Introduction to IT. UNIX Shells. Objectives. To describe what a UNIX shell is. To describe briefly some commonly used shells. What is a shell?. A command interpreter. Runs external commands like cp and rm . Built-in commands change shell environment: cd – change directory

Download Presentation

CSC 140: Introduction to IT

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. CSC 140: Introduction to IT UNIX Shells CIT 140: Introduction to IT

  2. Objectives • To describe what a UNIX shell is. • To describe briefly some commonly used shells CIT 140: Introduction to IT

  3. 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. CIT 140: Introduction to IT

  4. Environment Variables CIT 140: Introduction to IT

  5. Shell Initialization Files • Configure shell settings at login. • Create aliases. • Set environment variables. • bash initialization files • /etc/profile System-wide for sh and bash. • /etc/bashrc System-wide for bash. • ~/.bashrc User startup file. CIT 140: Introduction to IT

  6. sh/csh Differences CIT 140: Introduction to IT

  7. Which Shell Suits Your Needs? CIT 140: Introduction to IT

  8. sh/csh Similarities CIT 140: Introduction to IT

  9. How to change your shell? • Change your login shell. > chsh zsh • Run the other shell directly > echo $SHELL /bin/bash > zsh % CIT 140: Introduction to IT

  10. 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. CIT 140: Introduction to IT

  11. CIT 140: Introduction to IT

  12. CIT 140: Introduction to IT

  13. Globbing • ?  Matches any one character. • *  Matches zero or more characters. • []  Matches list of characters inside brackets. CIT 140: Introduction to IT

  14. 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 CIT 140: Introduction to IT

  15. Command History Up-arrow Previous command Down-arrow Next command history List old commands !! Previous command !# Command # !$ Last arg of previous command CIT 140: Introduction to IT

  16. 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 CIT 140: Introduction to IT

  17. Filename completion TAB Completes filename TAB-TAB Show list of possible completions. CIT 140: Introduction to IT

More Related