Mac Bash Terminal

Tags: macOS

A comprehensive, step-by-step guide to the Mac terminal and Bash environment specifically designed for novice Mac users

Last updated 2022-01-10 | 4.3

- Use the Mac Terminal app with confidence
- Write simple bash scripts
- Customize the bash shell environment

What you'll learn

Use the Mac Terminal app with confidence
Write simple bash scripts
Customize the bash shell environment
change permissions on files and folders when needed
Create
move
rename
delete and modify files with ease using the Terminal

* Requirements

* Only basic computer skills is needed
* Admin rights required for software installs (optional)
* Admin rights required for security section of the course

Description

Overview

This is a comprehensive course designed to show how to use the Terminal app in Mac OS X and many Bash shell commands, many overlap with Linux or other *nix variants.

The course currently covers the following:

  • Setup and installation of tools used in this course (outside the Terminal app)
  • How to navigate while in the Terminal (file and directory oriented)
  • How to manage files and directories (create, edit, delete, etc)
  • Temporarily elevating to admin rights when needed
  • Changing permissions on files and folders
  • Writing simple Bash scripts

Each one of these concepts is demonstrated in a methodological, step-by-step manner so you can follow along for easy learning.

Course Outline

Introduction provides an overview for the course.

Installation provides step-by-step instructions on how to setup Terminal and all the related tools for the course.

The Basics provides the first look at several core or foundational commands. While learn how to get around, manage files and even some simple ways to use the output of commands.

After the basics are covered, we dive into permissions related concepts by assuming admin user while we change permissions on files and folders.

Finally, we cover some more Advanced topics like writing a Bash shell script and customizing the Bash environment.

Course Features

Presentations provide audio/video training of conceptual ideas in each major area or introduction of new concepts.

Screencasts provide a video of the instructor's computer system with any actions, commands, or screens displayed and narrated. There are several hours of screencat video content -- it makes up the vast majority of the course. Any command line based screencast will include a command listing in the lecture downloads.

At the end of each section is a document lecture with a listing of commands or a brief tutorial regarding the video content covered during that section.

Who this course is for:

  • Anyone wanting to take their Mac understanding to the next level
  • Programmers, developers, software engineers needing to learn the Terminal to use command-centric tools like NodeJS, npm, Bower, Ruby, Compass, Maven, and many others
  • Any Mac user unfamiliar with the command line or Terminal app

Course content

6 sections • 34 lectures

Welcome: Goals and Approach Preview 02:15

An overview of the topics that will be covered, including introduction,  installation and setup, basic commands, advanced topics, and tips and  tricks. As well as an explanation of how this course is formatted, with  minimal slides, practice examples and reference materials, step-by-step examples, building up on prior lessons, and more condensed videos.

The Command Line and Bash Shell Preview 02:14

An overview of what a bash terminal is, a command line interpreter default to Mac OS and Linux called Bourne Again Shell that supports simple programming and scripting.

Also an overview of why the terminal is still relevant today, including command like focused tools like Git, Ruby on rails, Maven, and more, online help being command line focused, and that it's an excellent tool for teaching concepts.

Setup Overview Preview 00:51

An overview of the ways we will be setting up our terminal App as well as our text editor TextMate 2.

Locating the Terminal Preview 01:04

A quick guide to locating where the terminal application is on our Mac system, pinning it to the dock for easy access.

Terminal Settings Preview 02:00

Adjusting the size of the text and window within the terminal preferences.

Install TextMate 2 Preview 02:02

Installing the text editor TextMate 2 on our local Mac OS system.

Configure TextMate 2 Preview 01:18

Configuring TextMate 2 to be more usable throughout the rest of this course.

Installation and Setup Instructions Preview 2 pages

Basic Commands Overview Preview 00:51

Executing each of several basic Bash terminal commands, allowing us to navigate in bash, work with files and folders, open text editors, output commands to a file, and chain commands together.

Getting Around with pwd, cd and ls Preview 03:40

Using the basic navigational commands pwd, cd, and ls to move around and view the file system on our local mac operating system.

Cleaning Up with clear and Exiting the Terminal Preview 02:15

Using commands to clear off the stuff on the terminal screen, as well as using shortcuts and a command to exit out of our terminal when we are done.

Echo....Echo... Preview 01:36

Using the echo command to repeat text or variables back to ourselves.

Where are Commands with which and How to Use Them with man Preview 02:13

Locating where our commands are located on our system, which allows us to determine if one command is potentially running from the wrong location, as well as using the man command to get documentation within our terminal about specific commands.

Reviewing Files with cat, less and nano Preview 04:12

Using a basic command (cat) as well as a more complex command (less) and a full text editor (nano) to view files on our local system.

Using TextMate from the Terminal Preview 01:40

Opening our GUI based text editor TextMate with our files from our terminal.

Access Files and Directories with the open Command Preview 02:52

Using our open command to view a current directory within our GUI based Finder application, as well as opening files with the default editor we can set up on our Mac system.

Create, Move, Rename, and Delete Files Preview 03:39

Creating, moving, copying, renaming, and deleting files within our bash terminal using touch, mv, cp, and rm.

More Tricks with touch Preview 01:02

Updating the time a file was last modified by touching it with the touch command.

Creating and Deleting Directories Preview 03:51

Creating and deleting directories within our bash terminal by using mkdir and rmdir, in addition to using parameters with those commands to extend the functionality.

Sending the Output of a Command to a File (Output Redirection) Preview 03:03

Using the greater than and less than signs to send the output of commands to create or append to a text file on our system.

Chaining Commands Together with Pipes Preview 02:19

Using the tee command to write text to a file, similarly to the last lesson, and then learning how to use pipes '|' to chain commands together without having to put them in on two separate lines, using the output of one command as the input for the next.

Basic Commands Reference Preview 5 pages

Security Overview Preview 00:32

Running commands as a root user, which allows us to change the owners of files as well as the group that files are a part of.

Execute Commands as Admin (root) with sudo Preview 02:29

Escalating permissions using the sudo command to gain root access and then create and delete files.

Changing File Ownership with chown and chgrp Preview 04:33

Using the commands chown and chgrp to change the owner or group of files respectively, in order to allow lesser users to gain permissions to change files.

Recursively Changing Ownership Preview 03:47

Using the sudo command to change ownership recursively to directories and all files and folders within those directories.

User, Groups, and Security Commands Reference Preview 2 pages

Advanced Overview Preview 00:32

A quick overview of the more advanced topics covered in this section, including executing scripts, creating scripts, looking at our history, and customizing the bash shell environment.

Bash Scripting Preview 02:43

Creating our first shell script, a hello world type script, and then executing it within our Bash terminal.

Bash History Preview 02:27

Looking at quasi hidden files (files that start with a dot), in order to find and look at the file on our system that contains our past bash history.

Bash Profile and Customizing the Bash Environment Preview 04:15

Customizing our bash environment by creating an alias that allows us to have a shortened version of a longer command.

Advanced Commands Reference Preview 1 page

Conclusion Preview 01:05

A final overview of what we have covered in this course and why.

Bonus: Exclusive Student Discounts Preview 04:49