Neon
Course Description
Command-line skills are essential for modern developers. Linux has become the backbone of modern computing, and most developers today rely on tools built on the command-line, no matter if you're on Mac, Windows, or Linux! In this course, you will learn powerful commands, use Ubuntu, quit VIM, handle package management, and write your own shell scripts.
This course and others like it are available as part of our Frontend Masters video subscription.
Preview
CloseWhat They're Saying
Amazing course and amazing person! Brian explained everything really well and I'm really glad I bought a membership.

Imad El Jabouri
Imad El Jabouri
I have completed this course and highly recommend it to everyone who wants to understand the CLI in detail.

mohit
DevMohitAr
I just completed "Complete Intro to Linux and the Command-Line" by Brian Holt on Frontend Masters! Plenty of powerful and handy Linux CLI skills were gained.

Leslie Wong
LeslieWongH1
Course Details
Published: August 17, 2020
Learning Paths
Topics
Learn Straight from the Experts Who Shape the Modern Web
Your Path to Senior Developer and Beyond
- 200+ In-depth courses
- 18 Learning Paths
- Industry Leading Experts
- Live Interactive Workshops
Table of Contents
Introduction
Section Duration: 31 minutes
- Brian Holt gives an overview of the course, adds that the course focuses mainly on the CLI, and explains why developers need a good understanding of the CLI.
- Brian gives an overview of the history of the Unix operating system, including its creation at Bell Labs, and adds that the Unix philosophy and guiding principles are still applied today by software engineers.
- Brian explains that Linus Torvalds created Linux using the Unix codebase and made Linux free and open source, gives a high level overview of the Linux Kernel, and explains the difference between Linux and Linux distros.
- Brian describes what virtualization is, and explains how to get Linux running on Windows 10 and macOS operating systems with either VirtualBox or Multipass. Virtualization gives engineers the capability of running multiple operating systems and applications on a single computer or server.
The CLI
Section Duration: 1 hour, 1 minute
- Brian explains that within a terminal, there is a command line, which has a REPL, or Read Evaluate Print Loop, that allows engineers to only write one line of code at a time. The difference between a shell and an emulator is also discussed in this section.
- Brian demonstrates how to navigate through the different directories within a machine, and explains that arguments or parameters are similar and used to navigate within the CLI.
- Brian demonstrates how to use flags on the command line, and explains that similarly to arguments, flags are information that can are used in CLI commands.
- Brian gives an overview of best practices for searching for a command, a program, a directory, the bash history, or a document on the command line.
- Brian continues to explore the command line interface by demonstrating how to find the history of bash commands that have been used. Useful interactions like clearing, copying and pasting, and repeating the last command are also discussed in this section.
- Brian demonstrates shortcuts using the CTRL key within the CLI useful for developers every day.
- Brian explains that signals are notifications that are sent to programs from the command line, and gives examples of signals such as CTRL + D -SIG, a signal used in the command line to signal the end of the use of a program. SIGTERM and SIGKILL are also discussed in this section.
Editors
Section Duration: 22 minutes
- Brian gives an overview of text editors already available within the command line, and starts with nano, one of the most common and available options.
- Brian gives a brief history of VIM, an editor within the CLI, explains how VIM builds off of previous editors.
- Brian reviews basic VIM commands, including starting VIM, editing a file, and saving a file. Also covered is how to quit VIM, which is the only command worth remembering, according to Brian.
Files, Pipes, & Permissions
Section Duration: 1 hour, 37 minutes
- Brian gives an overview of the commands on the CLI that allow developers to read a file, to create one or multiple files, to learn more about a specific program, or to view a snapshot of a given file.
- Brian demonstrates how to create a file from the command line, how to check that the new file was created, how to delete a file, how to rename a file, how to compress a file, and how to delete a folder. Exercising caution when using the delete or 'rm' functionality is also discussed.
- Brian explores wildcards, expansions, and replacement, and explains how and why they fixtures in a developer's toolkit.
- Brian explains that one of the Linux philosophies is the assumption that the output of a program can be the input to another program through streams and pipes, demonstrates how to redirect the output to another file. This section focuses mainly on 'stdout' and 'stderr'.
- Brian explains that stdin (pronounced standard in) is used for input streams using the 'cat' command to input the text of one file into another.
- Brian explains that in order to move from one program to another within the command line, developers have to use pipes. A few commands that allow users to remove multiple files or find multiple files with common characteristics are also explored in this segment.
- Brian explores the Linux security and permissions model, which is centered around the concepts of users, privileged and unprivileged roles, and the permission model.
- Brian demonstrates how superuser commands grant access to the root user role, and explains best practice to create other users.
- Brian explores group permissions by changing the ownership of various files, and demonstrates what commands to use for each type of permission change.
- Brian gives an overview of a few numbers used to change permissions such as read, write, or execute through the terminal.
Environments & Processes
Section Duration: 33 minutes
- Brian explains that environment variables are already set in Bash, and demonstrates how to add new environment variables using .bashrc.
- Brian defines a process as any sort of command that is currently running, for instance, running bash from the terminal. Interacting with processes is also explained, as well as why they are important.
- Brian explains how to run a sequence of commands and subcommands as well as exit codes using exit codes, and process operators. Operators allow engineers to run a task once another task has been completed.
- Brian explains that when invoking a command within another command, that command is called a subcommand, and runs a few subcommands as examples
Networking & the Internet
Section Duration: 56 minutes
- Brian explains that SSH allows the creation of an intranet, and demonstrates how to create a secondary virtual machine.
- Brian creates an SSH key in the primary machine and links the secondary machine to the primary machine using a public key. Linking two virtual machines is the simplified version of what various cloud companies offer as a main service.
- Brian explains that it is possible to transfer files using an SFTP connection with an SSH key, and demonstrates how to securely transfer files between a remote machine and a local one.
- Brian explains that wget is the network version of cp or copy, adds that wget allows developers to interact with downloads, and that wget allows recursive downloads.
- Brian explains that 'curl' is a Linux program that allows developers to test against API servers, starts running an API server locally and uses curl to hit the API endpoint.
- Brian explores the various HTTP verbs used with 'curl' commands, and demonstrates how to copy a network request. The use of headers and cookies with the curl program is also discussed in this section.
Package Management
Section Duration: 31 minutes
- Brian gives a brief overview of package management, focuses on the package management tool (APT), and reviews commands.
- Brian answers questions from the audience about the different APT commands, namely what are the differences between apt upgrade and apt update.
- Brian explains that snaps are a new format for installing dependencies, and adds that snaps are useful for developers because they are more secure and update automatically.
Shell Scripts
Section Duration: 48 minutes
- Brian explains that developers can create shell scripts with bash to automate a task, and demonstrates how to create, build, and run a shell script.
- Brian explains that hashbang, prounounced "shabang" is a line that starts with the characters '#'! in a Bash script and that indicates how the bash file should run. For instance, the hashbang can indicate in what language a file should be interpreted. This section also includes a demonstration of how to add a hashbang is a script.
- Brian demonstrates how to create paths to Bash scripts to simplify running scripts through the terminal without having to be in a specific directory. Then, best practices to add variables to a bash script and allow the script to access a variable are outlined.
- Brian demonstrates how to pass in the path to a given directory and how to move documents to that directory using arguments.
- Brian explains that control flows can be used in Bash scripts, and adds that if statements are syntax sugar for tests in bash. In other words, every if statement written in a Bash file is a disguised test.
- Brian continues exploring bash script by live coding scripts with 'else' and 'case' statements, and live coding another script that contains case statements. The tools introduced are designed to give viewers the basic tools to write more sophisticated bash scripts
- Brian continues adding complexity to the bash script started in the previous segment by demonstrating how to use loops and arrays.
Automation & Customization
Section Duration: 21 minutes
- Brian explains that developers use the cron command when a specific job or program needs to be executed following a schedule, and demonstrates how to build a cron job.
- Brian explains that the prompt is the bit that shows up on every new line, and demonstrate how to customize it.
- Brian continues to demonstrate how to customize the prompt by adding new colors and recommends the use of Awesome Bash to take the prompt customization a step further.
Wrapping Up
Section Duration: 4 minutes
- Brian thanks the audience, and shares some suggestions about what to focus on next in the learning journey.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops