Command Line Intro

Basic Usage

Part 1 : What is the terminal?

Terminal/Shell

Open a terminal.

Demo - First Commands

demos/02-first.sh

Tab Completion and Command History

demos/02-tab_and_history.sh

Part 2 : Where are my files?

Demo - Navigation

demos/03-navigation.sh

Command Arguments and Options

Creating and Deleting Files and Directories

Commands:

Demo - Creating and Deleting Files and Directories

demos/04-createdelete.sh

Absolute and Relative Paths

Demo - Absolute and Relative Paths

demos/04-rel_abs_paths.sh

Part 3 : Sandboxes

Sandboxes

Demo - Sandboxes

demos/05-sandboxes.sh

Practice

Download the sandbox for this module and perform the following task:

  1. How many directories are in the sandbox directory?
  2. How many files are in the sandbox directory?
  3. Go into the directory named data/
    1. Delete the file named run03.txt
    2. Determine how many files are in the directory named old/, without going into the directory.
    3. Delete the directory named old/
  4. Go back to the top directory in the sandbox.
  5. The directory named config/ contains a subdirectory named resources/. Go into this directory.
    1. Use ls -l to list the files and directories in the top level of the sandbox from this directory.
    2. The directory named config/ (in the top level of the sandbox) also contains a subdirectory named physical_quantities/, which contains a file named constants.txt. Delete this file without changing directories.
    3. The directory named config/ (in the top level of the sandbox) also contains a subdirectory named tmp/. Delete this directory without changing directories.

Part 4 : Working with many files at once

Globs/Wildcards and Expansion

The shell provides some useful features for generating argument lists.

Wildcards

Expansion

These are provided by the shell, so they will work for all commands.

Demo - Wildcards and Expansions

demos/07-wildcards.sh

Part 5 : Spaces…

Spaces

Demo - Spaces

demos/09-spaces.sh

The End

Last Slide

This slides intentionally left blank