AcademyTerminal Tactics: Survival in the ShellPhase 8: Terminal Scribing (Text)

Lesson 2: The Quick Draw (Nano & Shell Configuration)

Vim is powerful, but it has a steep learning curve. For quick edits, Nano is the friendlier alternative — and knowing both makes you versatile.

Nano: The Friendly Editor

Nano shows its shortcuts right at the bottom of the screen. No modes, no surprises.

nano filename.txt

Essential Nano Shortcuts: | Shortcut | Action | |----------|--------| | Ctrl + O | Save (Write Out) | | Ctrl + X | Exit | | Ctrl + K | Cut (delete) current line | | Ctrl + U | Paste the cut line | | Ctrl + W | Search for text | | Ctrl + G | Show help |

When to Use What?

| Editor | Best For | Learning Curve | |--------|----------|---------------| | Vim | Complex edits, macros, speed | Steep 🏔️ | | Nano | Quick config changes | Gentle 🌊 | | VS Code (via SSH) | Full development | Moderate 🏕️ |

The Magic of .bashrc

The .bashrc file is your shell's configuration file. It runs every time you open a new terminal. You can customize:

  • Aliases — Shortcuts for long commands:

    alias ll='ls -la'
    alias gs='git status'
    alias deploy='cd /opt/app && git pull && npm run build'
    
  • Environment Variables — Settings for your tools:

    export EDITOR=nano
    export PATH="$PATH:/usr/local/go/bin"
    
  • Custom Prompt — Make your terminal look professional:

    PS1='\[\e[32m\]\u@\h\[\e[0m\]:\[\e[34m\]\w\[\e[0m\]\$ '
    

After editing .bashrc, apply changes with:

source ~/.bashrc
booting...

Mission Objective

Customize your terminal environment:

  1. Try nano: Open a file with nano notes.txt (type something, then Ctrl+O to save, Ctrl+X to exit).
  2. Inspect your config: View your current shell settings with cat ~/.bashrc.
  3. Create a shortcut: Add an alias with echo "alias ll='ls -la'" >> ~/.bashrc.

Pro Tip

Many DevOps engineers keep their dotfiles (.bashrc, .vimrc, .gitconfig) in a Git repository so they can set up any new server in seconds with their preferred configuration.

Mission Control

Open a file with nano

Expected Command

nano notes.txt

View the .bashrc file

Add an alias to .bashrc