Learn to Code
All tracks
Learn to Code

Free lessons from scratch to pro — every language, databases and DevOps.

AboutContactPrivacy PolicyTerms of Use

Your progress is saved in this browser. © 2026 Learn to Code

>_
Terminal & Command Line
0/10 completed
Beginner
What is the terminal?Navigating foldersWorking with files and foldersViewing files
Intermediate
Wildcards and finding filesPipes and redirectionText processing: grep, sort, cut and friends
Advanced
Environment variables and PATHPermissions and processes
Pro
Shell productivity: aliases, scripts and dotfiles
Tracks / Terminal & Command Line / Pro

Shell productivity: aliases, scripts and dotfiles

Pros don't type faster; they type less. Aliases, history tricks, scripts and a well-tuned shell configuration turn repetitive work into a single word.

History: never retype a command

Linux terminal (simulator) · editable
Shortcut Does
↑ / ↓ Step through previous commands
Ctrl + R Search history as you type (press again for older matches)
!! Repeat the last command: sudo !! reruns it with sudo
!42 Run command number 42 from history
!$ The last argument of the previous command: mkdir new && cd !$

Aliases: your own shortcuts

Linux terminal (simulator) · editable

Popular aliases developers add:

bash
alias ll='ls -lah'
alias gs='git status'
alias gc='git commit -m'
alias gp='git push'
alias dc='docker compose'
alias serve='python3 -m http.server 8000'
alias ports='lsof -i -P | grep LISTEN'

Aliases vanish when the terminal closes, unless you put them in a dotfile.

Dotfiles: your shell configuration

Files starting with . in your home folder configure your tools. They're called dotfiles.

Linux terminal (simulator) · editable
Dotfile Configures
~/.bashrc / ~/.zshrc Your shell: aliases, PATH, prompt, functions
~/.gitconfig Git user, aliases, default branch
~/.ssh/config SSH shortcuts for servers
~/.vimrc, ~/.config/ Editors and other tools

Many developers keep their dotfiles in a Git repository so they can set up a new laptop in minutes. Search GitHub for "dotfiles" for inspiration.

Shell scripts: save commands as programs

A script is a text file of commands. Run it, and it executes them in order:

Linux terminal (simulator) · editable

Anatomy of a script:

bash
#!/bin/bash          ← "shebang": which program runs this file
# comments start with #
echo "Hello, $1!"    ← $1 = first argument, $2 = second…
echo "$# args: $@"   ← $# = number of arguments, $@ = all of them

Write your own

Create a backup script that copies a folder into a dated backup folder:

Linux terminal (simulator) · editable

On a real machine, write scripts in an editor (nano backup.sh, or VS Code). Real bash scripts can also use if, for loops, functions and more: see the Bash Scripting track.

Script safety settings

Start serious scripts with this line, so a failing step stops the script instead of carrying on with broken state:

bash
#!/usr/bin/env bash
set -euo pipefail    # exit on error, on undefined variables, and on failures inside pipes

Tools that supercharge your terminal

Tool Why
Oh My Zsh / Starship A beautiful prompt showing your git branch, status and language versions
fzf Fuzzy search for files, history (Ctrl + R) and git branches
zoxide (z) Jump to frequently used folders: z web → ~/projects/website
ripgrep (rg) A blazing-fast grep that respects .gitignore
bat cat with syntax highlighting
eza A modern ls with colours and git status
tmux Split panes, and sessions that survive disconnects on servers
tldr Short, practical examples for commands: tldr tar

🎓 Terminal track complete!

You can navigate, manage files, search and transform text with pipelines, configure your environment, manage permissions and processes, and automate with aliases and scripts. That's the foundation for Git, Docker, Linux servers and Bash scripting.

Practice

  1. Create aliases docs (cd ~/Documents) and logs (tail -n 5 ~/data/app.log) and test them.
  2. Write a script report.sh that prints the number of ERROR lines and WARN lines in ~/data/app.log. Make it executable and run it.
  3. Add an alias to ~/.bashrc with echo "alias c='clear'" >> ~/.bashrc, then source it and test it.
Linux terminal (simulator) · editable
✎ Check your understanding

1.In a script, what is $1?

2.How do you make an alias permanent?

← Permissions and processes