Instructor: Alyssa Dai
Outline
To follow most of the other modules, you will need some basic understanding of the command line. In this module, weβll learn about the command line using the Bourne Again SHell (Bash), the default shell in most Linux systems.
You will learn how to use the command line to:
- move around on your computer and work with directories (folders) and files
- find things (files, directories, file contents, etc.)
- run useful command-line programs and find help (
find,grep,ls, andman/documentation) - work with variables (e.g.,
$PATH) and basic shell scripts
Questions you will be able to answer after taking this module
-
What is a command-line shell?
-
Among thousands of files in a folder, how would you copy just the ones with names starting with
"DATASET_subject..."to a different directory on your computer? -
Among thousands of files and directories you know know there is a file where the file contents include the phrase
"Backup of my Thesis". How would you find this file? -
What is an environment variable, and how can you change it?
Material
Extra resources
- Bash cheatsheet
- explainshell: see the help text for each argument in a given shell command
- other resources for learning Bash
How to make your terminal βprettierβ
If you feel you do not want to spend time working in the terminal because βit looks ugly,β you can install some tools that will help you personalize your terminal!
Examples:
-
starship works with most shells and operating systems and offers plenty of options in terms of looks and prompt configuration.
-
oh-my-zsh is designed for
zsh(default shell on most Macs), and offers many themes for your prompt but also many plugins with many aliases to help you be more productive.- oh-my-bash is the equivalent for
bash.
- oh-my-bash is the equivalent for
-
oh-my-posh works with most shells and operating systems and offers a wide range of themes for your prompt.