Getting to grips with the shell - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Getting to grips with the shell

Description:

Getting to grips with the shell. An introduction to the UNIX shell. Graham Bleach, Feb 2006 ... Open a terminal emulator. Run a command. ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 12
Provided by: hantsl
Category:

less

Transcript and Presenter's Notes

Title: Getting to grips with the shell


1
Getting to grips with the shell
  • An introduction to the UNIX shell.
  • Graham Bleach, Feb 2006

2
Overview
  • What is a shell?
  • Why would I need to use the shell?
  • How do I use it?

3
What is the shell?
  • The outer layer of the OS
  • Nearest the user
  • Interactive
  • Often means the UNIX command line.
  • There are other sorts of shell.
  • Bash, the Bourne-Again Shell.

4
Why use it?
  • Some things impossible with a GUI.
  • You can automate things.
  • Can be faster than using a GUI.
  • Text commands are repeatable.

5
Getting started
  • Open a terminal emulator.
  • Run a command.
  • Use the up/down arrows to repeat commands and
    correct mistakes.

6
Basic navigation
  • Display your current directory with pwd.
  • List files with ls
  • Use cd to change directory.
  • Show file contents with cat.
  • Or, more usefully with less.

7
Saving time
  • Too much typing is a waste of time.
  • Tab completion
  • On command names
  • On file names.
  • Reverse search (Ctrl-r).

8
Saving output
  • We can save the output of a command using gt
  • Example Finding lines which say Bleach
  • Be careful not to write back over the file you
    started with

9
Doing more than one thing
  • Using temporary files is messy and slow.
  • Commands can be connected to each other using
    pipes.
  • command1 command2
  • e.g dmesg less

10
Scripting
  • Putting commands that we typed interactively into
    a file.
  • At the top of the file we need !/bin/bash

11
Finding out more
  • Manual pages
  • apropos
  • man
  • whatis.
  • Advanced bash scripting guide.
  • Think UNIX, Jon Lasser.
  • Mailing list.
Write a Comment
User Comments (0)
About PowerShow.com