Lesson 03
Just Enough CLI
Learn essential command line skills for data work: basic commands, CLI editors, ZSH vs BASH, plus plugins and themes to speed up your terminal.
The Command Line Interface essentials — basic commands, CLI editors, ZSH vs BASH, plugins and themes.
What this video covers
A shell is a program that runs commands — the ones you type into a terminal window. It’s also a
small programming environment: Unix workflows lean on breaking tasks into small components and
piping them together instead of clicking through a GUI. Every Unix shell (bash, zsh, the C shell)
traces back to the Bourne shell (/bin/sh) from early Unix. This lesson covers why the CLI matters
for data roles, how to set up a modern shell on Mac and Windows, and the core commands you’ll reach
for constantly in day-to-day analytics and engineering work.
Hands-on labs
Practise in a terminal right in your browser
Labs give you a folder of realistic data files and tasks that check themselves, with nothing to install. Every task has a hint, the expected result, and a solution. Open the CLI labs →
Key moments
- Why data people need the CLI — SSH into a VM, edit config files with
nano/vim, run Git, drive AWS/Azure/GCP without the console, set up cron jobs, and automate scripts. Both engineers and analysts lean on it; it’s less common day-to-day for analysts but shows up constantly for engineers. - Shell prompts —
$means a normal user,#means root/admin, and the C shell ends its prompt with%. - Setting up Linux on Windows — install WSL (
wsl --installfrom an admin CMD) to get a real Linux environment without dual-booting. - Oh My Zsh on Mac — Mac has used zsh as the default shell since Catalina; installing
Oh My Zsh adds themes and plugins, including
zsh-autosuggestions(autocomplete) andzsh-syntax-highlighting. - The essential commands —
cat,ls,cp,mv,touch,rm,echo,cd,mkdir,rmdir,grep,less,pwd,diff,file,find/locate,head/tail, andsort. - Wildcards and regex —
*for glob matching (at*,*at,*at*) versusgrep’s regular expressions (.,.*,.+) — related but different syntaxes worth not confusing. - Variables,
PATH, and permissions — shell vs. environment variables (export), howPATHtells the shell where to find commands, and reading/setting file permissions withchmod. - Archiving —
gzip/gunzipcompress a single file;tarpacks multiple files and directories into one archive.
Basic commands cheat sheet
| Command | What it does |
|---|---|
cat file1 file2 | Print the contents of one or more files |
ls -l | List a directory’s contents (long format) |
cp file1 file2 | Copy a file |
mv file1 file2 | Move or rename a file |
touch file | Create a file, or update its modified timestamp |
rm file | Delete a file |
cd dir | Change the current working directory (~ is home) |
mkdir dir / rmdir dir | Create / remove a directory (rm -r dir for a non-empty one) |
grep root /etc/passwd | Print lines matching a pattern (-i case-insensitive, -v invert) |
less file | Page through a large file or long output |
pwd | Print the current working directory |
diff file1 file2 | Show the differences between two text files |
find dir -name file -print | Search a directory tree for a file by name |
head / tail | Show the first / last lines of a file or stream |
sort | Put the lines of a text file in alphanumeric order |
Variables, PATH, and permissions
Shell variables hold values inside the current shell session:
HOST=127.0.0.1
echo $HOST
Environment variables are shell variables passed down to every program the shell runs — promote
one with export:
STUFF=blah
export STUFF
PATH is the environment variable that lists the directories the shell searches for commands:
echo $PATH
# /usr/local/bin:/usr/bin:/bin
File permissions (r/w/x for read/write/execute) are set with chmod:
chmod 644 file # rw for you, read-only for everyone else — typical for files
chmod 755 dir # rwx for you, read/execute for everyone else — typical for dirs and programs
Next steps
- Continue with Just Enough GitHub to put version control on top of your new command-line skills.
- The full companion notes for this video live in the Surfalytics analytics-course repo if you want the complete reference, including the Windows/WSL setup steps and the special characters table.
This lesson is for members only
Join Surfalytics to unlock all 7 lessons in this module, plus every module, project, mock interview, and the private community.
7-day free trial · Cancel any time