Intro to the bash shell¶
Intro and Objectives¶
You will learn how to use the bash shell - a very common command line interface on Linux systems. Why learn the bash shell?
Many Linux tasks rely on you being a competent bash shell user
Massive efficiency and productvity gains possible using bash
Gets you closer to the computer and increases your technical sophistication
Reinforces notion of functional decomposition - little programs that do one thing well
You will learn to use the bash shell to do (among other things):
navigation through the file and folder structure on your computer
file and folder manipulation (create, delete, move, copy)
run programs
get information about your computer system
use pipes and filters to accomplish file management tasks by combining multiple shell commands
Readings¶
Read Sections 1-4 of the Software Carpentry tutorial entitled: The Unix Shell
Note
In the “Learn Enough Command Line to be Dangerous…” tutorial, there are two nice boxes describing the “magic of computers” and “technical sophistication”. READ THEM.
[OPTIONAL] A few more Linux shell tutorials that I have found useful are:
Downloads¶
unix command line cheat sheet (from Dave Child at Cheatography)
Activities¶
We will use the presentation slides (in the Downloads) to guide our discussion and hands-on exercises to learn the basics of using the bash shell.
What is the bash shell?¶
An example from a research project¶
File management¶
Understanding how the file system is laid out and to do things like navigating the folder tree, name files, copy/move/delete files and directories.
SCREENCAST: File management (21:16)
Combining commands to explore and manipulate files¶
Use pipes, redirection and filters to accomplish file management tasks by combining multiple shell commands
A few more useful bash commands¶
Learn how to use bash to edit files, search files, grab data from websites. Also, where to go to learn more and solutions to the challenges.
[OPTIONAL] Intro to Shell for Data Science course at DataCamp¶
If you’re using DataCamp for the Classroom in my class, you also have access to the following course:
Sections 1-3 cover very similar ground as done in my screencasts. Subsequent sections go a bit further and get into shell variables and basic shell scripting. It’s interactive and an efficient intro the bash shell.
Explore (OPTIONAL)¶
explainshell.com - cool site that explains the pieces of any shell command you want
File Not Found - a popular article about why younger people may be struggling with the notion of a file and directory structure
Bash Guide for Beginners - tries to fill learning gap
How to install and use the bash shell with Windows 10 - a surprising development
Anatomy for first year computing and IT students - learn how stuff works by exploring its innards