Skip to content

Commit

Permalink
Getting to know the command line (#80)
Browse files Browse the repository at this point in the history
* add updated getting to know the command line

* fix links

* Update main.yml
  • Loading branch information
jeromehardaway authored Feb 8, 2024
1 parent be8d430 commit 264b0f2
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 124 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI
on:
pull_request:
types: [opened]

jobs:
generate:
runs-on: ubuntu-latest
Expand All @@ -13,19 +14,23 @@ jobs:
reaction: rocket
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: actions/checkout@master

- uses: actions/checkout@v2 # Updated to use v2 for better performance and features
with:
ref: ${{ github.head_ref }}

- name: Dump GitHub context
id: github_context_step
run: echo '${{ toJSON(github) }}'
# Enclose the JSON in double quotes and escape internal double quotes to prevent shell errors
run: echo "${{ toJSON(github).replace('\"', '\\\"') }}"

- name: Install modules and run it
run: yarn
if: steps.check.outputs.triggered == 'true'

- name: Generate Curriculum
run: yarn generate:curriculum:ci
if: steps.check.outputs.triggered == 'true'
env:
GITHUB_HEAD_REF: '${{ github.head_ref }}'
GITHUB_ACTOR: '${{ github.actor }}'

GITHUB_HEAD_REF: ${{ github.head_ref }}
GITHUB_ACTOR: ${{ github.actor }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Welcome to "Getting to Know the Command Line," the inaugural unit in our module.

## Table of Contents

1. **[What is the Command Line?](#what-is-the-command-line)**: We'll start by demystifying the command line and exploring its core definition and functionalities.
1. **[What is the Command Line?](what-is-the-command-line.md)**: We'll start by demystifying the command line and exploring its core definition and functionalities.

2. **[Why Use the Command Line?](#why-use-the-command-line)**: Discover why the CLI is not just an alternative but often a preferred environment, offering speed, versatility, and automation.
2. **[Why Use the Command Line?](why-use-the-command-line.md)**: Discover why the CLI is not just an alternative but often a preferred environment, offering speed, versatility, and automation.

3. **[Terminal vs. Shell](#terminal-vs-shell)**: Dive into the nuanced relationship between the terminal and shell, clarifying their distinct roles.
3. **[Terminal vs. Shell](terminal-vs-shell.md)**: Dive into the nuanced relationship between the terminal and shell, clarifying their distinct roles.

4. **[Terminal Emulators](#terminal-emulators)**: Get acquainted with popular terminal emulators, uncovering customization options and shortcuts to boost productivity.
4. **[Terminal Emulators](terminal-emulators.md)**: Get acquainted with popular terminal emulators, uncovering customization options and shortcuts to boost productivity.

5. **[Shell Types](#shell-types)**: Explore the various shell types available, including Bash, Zsh, Fish, and Dash, each with unique features and benefits.
5. **[Shell Types](shell-types.md)**: Explore the various shell types available, including Bash, Zsh, Fish, and Dash, each with unique features and benefits.

By the end of this unit, the command line will transform from a mysterious black box into a familiar and powerful toolset, ready to enhance your tech journey. Enjoy your exploration of the Command Line!
Original file line number Diff line number Diff line change
@@ -1,64 +1,54 @@
# Shell Types

Understanding the various shell types available on Linux and UNIX-like systems is crucial for optimizing your workflow and leveraging the full potential of the command line. This guide explores Bash, Zsh, Fish, and Dash, highlighting their unique features and use cases.

## Bash (Bourne-Again SHell)

### Overview
- **Platform**: Default shell on many Linux distributions and macOS until Catalina.
- **History**: A replacement for the Bourne shell, hence the name "Bourne-Again."
- **Platform**: Predominantly the default shell across many Linux distributions and macOS versions up to Catalina.
- **History**: Developed as an enhanced replacement for the original Bourne shell, symbolizing its progression with the clever play on words, "Bourne-Again."

### Features
- **Scripting**: Strong scripting capabilities, making it ideal for automation.
- **Compatibility**: POSIX compliant, ensuring it works in a variety of environments.
- **Scripting Excellence**: Bash is renowned for its robust scripting capabilities, making it a powerhouse for automation tasks.
- **POSIX Compliance**: Ensures broad compatibility across different computing environments, making Bash scripts highly portable.

## Zsh (Z Shell)

### Overview
- **Platform**: Default on macOS Catalina and later.
- **Extensibility**: Highly customizable and extensible through plugins and themes.
- **Platform**: Became the default shell in macOS Catalina, reflecting its growing popularity and support.
- **Extensibility**: Stands out for its customization possibilities, with a vibrant ecosystem of plugins and themes.

### Features
- **Autocomplete**: Offers advanced autocompletion features.
- **Theme Support**: Allows for a high level of customization through theming.
- **Advanced Autocompletion**: Elevates command line usability with superior autocompletion functionalities.
- **Theming and Customization**: Supports extensive customization, allowing users to tailor their command line experience.

## Fish (Friendly Interactive SHell)

### Overview
- **Goal**: Designed with usability in mind.
- **Compatibility**: Not POSIX compliant but offers many user-friendly features.
- **Goal**: Primarily focused on enhancing user interaction and simplicity.
- **Compatibility**: Chooses user convenience over strict POSIX compliance, introducing features aimed at improving the shell experience.

### Features
- **Autosuggestions**: Automatically suggests commands as you type.
- **Interactive**: Offers an interactive tutorial for new users.
- **Intelligent Autosuggestions**: Offers real-time suggestions based on command history and context.
- **Interactive Use**: Emphasizes ease of use with features like an interactive tutorial for newcomers.

## Dash (Debian Almquist Shell)

### Overview
- **Performance**: Designed to be lightweight, focuses on script execution speed.
- **Compatibility**: POSIX compliant but lacks some features found in other shells.
- **Performance**: Prioritizes efficiency and speed, especially for script execution, making it a favorite for system-level scripting.
- **Compatibility**: While POSIX compliant, it deliberately omits certain advanced features to maintain its lean profile.

### Features
- **Speed**: Primarily used for running system scripts quickly.
- **Minimalistic**: Lacks some features like advanced scripting capabilities, making it simpler but faster.
- **Execution Speed**: Optimized for fast script execution, Dash is often the go-to for system scripts.
- **Simplicity**: Offers a minimalistic feature set focused on executing scripts efficiently.

## Comparison

### Features
- **Bash**: Comprehensive set of features, strong scripting.
- **Zsh**: Extensible with many additional features like advanced autocompletion.
- **Fish**: Focuses on user experience, less emphasis on scripting.
- **Dash**: Minimalistic and fast, suitable for system scripts.

### Performance
- **Bash and Zsh**: Generally good performance but might be slower for some tasks compared to Dash.
- **Fish**: May consume more resources due to user-friendly features.
- **Dash**: Fastest for executing scripts.

### User-Friendliness
- **Bash**: Steep learning curve but widely used.
- **Zsh**: Easier for those familiar with Bash and offers additional user-friendly features.
- **Fish**: Most user-friendly but not ideal for heavy scripting.
- **Dash**: Not typically used for interactive sessions, mainly used for scripting.
### Key Considerations
- **Feature Set**: Bash and Zsh are feature-rich, catering to advanced users. Fish prioritizes UX, while Dash focuses on speed.
- **Performance**: Bash and Zsh provide comprehensive functionality with moderate performance. Fish may require more resources, and Dash excels in script execution speed.
- **User Experience**: Bash has a learning curve but is widely adopted. Zsh improves upon Bash with user-friendly features. Fish is the most approachable for beginners, whereas Dash is specialized for scripting rather than interactive use.

## Summary
Choosing the right shell depends on your needs—whether it's the robustness and compatibility of Bash, the extensibility of Zsh, the user-friendliness of Fish, or the speed of Dash. Understanding the differences can help you select the best tool for the job.

The choice among Bash, Zsh, Fish, and Dash hinges on individual needs—Bash for its universality and scripting, Zsh for customization, Fish for usability, and Dash for performance in scripting. Each shell offers unique advantages, making it important to consider your specific requirements and preferences when selecting a shell for your daily tasks.
Original file line number Diff line number Diff line change
@@ -1,56 +1,46 @@
# Terminal Emulators

Terminal emulators play a crucial role in bridging the graphical user interface (GUI) of modern operating systems with the power and flexibility of the command-line interface (CLI). This guide delves into what terminal emulators are, highlights popular options, and provides tips on customization and useful shortcuts.

## What's an Emulator?
A terminal emulator is software that mimics the functionality of a hardware terminal. Essentially, it replicates the behavior of the terminal within the GUI of your operating system, allowing you to access a command-line interface and run text-based commands.

A terminal emulator is a software application that replicates the functionality of traditional hardware terminals, enabling users to interact with the system through a command-line interface within their graphical desktop environment.

## Popular Choices

### Hyper
- **Cross-Platform**: Available for Windows, macOS, and Linux.
- **Web Technologies**: Built on HTML, CSS, and JavaScript.
- **Extensible**: Supports plugins for extended functionalities.
- **Platform Agnostic**: Works across Windows, macOS, and Linux, making it a versatile choice for users on different systems.
- **Built with Web Technologies**: Utilizes familiar web standards, allowing for easy customization and extension through plugins.
- **Extensibility**: The plugin architecture allows users to tailor their experience, adding functionalities like git integration or theme changes.

### iTerm2
- **macOS Specific**: Available only for macOS.
- **Advanced Features**: Offers advanced functionalities like split panes and search.
- **Customizable**: High level of customization, including themes and hotkeys.
- **Designed for macOS**: Offers deep integration with macOS features and aesthetics.
- **Feature-Rich**: Includes advanced options like search, split panes, and a robust set of shortcuts for efficient navigation.
- **Highly Customizable**: Users can extensively customize the look and feel, adjusting everything from fonts to color schemes and keyboard shortcuts.

### PuTTY
- **Windows Native**: Primarily used on Windows.
- **Network Protocols**: Supports SSH, Telnet, and other network protocols.
- **Simple**: Lacks the bells and whistles of other emulators but does the job efficiently.
- **Windows-Focused**: Though available on other platforms via ports, it's most commonly used in Windows environments.
- **Supports Various Protocols**: Facilitates connections over SSH, Telnet, and others, making it essential for remote system management.
- **Simplicity**: Provides a straightforward, no-frills interface focused on efficiency and functionality.

## Customization

### Fonts and Colors
- Most terminal emulators allow you to change fonts and text colors for better readability.

### Themes
- Some emulators support themes, letting you change the appearance according to your preference.

### Plugins
- Emulators like Hyper allow for plugins that can add features or integrate with other software.
### Visuals and Usability
- Adjusting **fonts** and **colors** can make the terminal more pleasant to use and reduce eye strain.
- **Themes** offer a quick way to change the visual appearance, with many emulators featuring downloadable themes created by the community.
- **Plugins** extend functionality, from aesthetic enhancements to productivity boosters like autocomplete extensions or command reminders.

## Shortcuts

### General
- `Ctrl+C`: Terminate the current command
- `Ctrl+Z`: Suspend the current command
- `Ctrl+A`: Move cursor to the beginning of the line

### Navigation
- `Ctrl+U`: Delete from the cursor to the beginning of the line
- `Ctrl+K`: Delete from the cursor to the end of the line
- `Ctrl+W`: Delete from the cursor to the start of the word
### General Productivity
- Learning keyboard shortcuts such as `Ctrl+C` for command termination and `Ctrl+Z` for suspending tasks can significantly speed up CLI interactions.

### iTerm2 Specific
- `Cmd+T`: New Tab
- `Cmd+D`: Split pane vertically
### Navigation and Editing
- Shortcuts like `Ctrl+A` to jump to the line's start and `Ctrl+U/K` for line editing make text manipulation more efficient.

### PuTTY Specific
- `Alt+F4`: Close window
- `Ctrl+Insert`: Copy selected text
### Emulator-Specific Shortcuts
- **iTerm2** users can leverage macOS integrations like `Cmd+T` for tab management, while **PuTTY** offers Windows-centric shortcuts such as `Alt+F4` for closing the window.

## Summary
Terminal emulators provide a convenient way to access the command line interface on modern computers. Understanding how to choose and customize your terminal emulator can significantly impact your productivity and effectiveness in command-line tasks.

Choosing the right terminal emulator can dramatically influence your CLI experience, impacting everything from productivity to enjoyment. By taking advantage of customization options and mastering shortcuts, users can create a tailored environment that meets their specific needs, making terminal emulation not just a tool, but an integral part of their computing practice.
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
# Terminal vs. Shell

Understanding the distinction between the terminal and the shell is crucial for anyone working with command-line interfaces or aiming to deepen their knowledge of system operations. This guide outlines the roles of each component, highlighting their differences and how they complement each other in the user's interaction with the system.

## Definitions

### Terminal
The terminal, also known as a terminal emulator, is the interface where users can type and execute text-based commands. It emulates the environment where the shell runs.
A terminal emulator provides a graphical interface for users to interact with the shell and the underlying operating system. It simulates the traditional electronic terminal, allowing text-based command input and output.

### Shell
The shell is the program that runs inside the terminal, interpreting and executing the commands entered by the user. It serves as the middleman between the user and the operating system.
The shell acts as an interpreter, executing user commands. It provides a scripting language and manages the communication between the user and the kernel, executing system commands and scripts.

## Differences

### Terminal
- **Interface**: Acts as a medium through which users interact with their system.
- **Environment**: Provides the environment in which the shell operates.
- **User Interface**: Serves as the point of interaction, presenting a graphical interface for command input and system feedback.
- **Environmental Host**: Hosts the shell, enabling users to access shell functionalities through a graphical or text-based interface.

### Shell
- **Interpreter**: Takes the user's commands from the terminal and instructs the operating system to perform them.
- **Scripting**: Allows for automation through scripting languages like Bash scripting or Zsh scripting.
- **Command Interpreter**: Processes and executes the commands entered in the terminal, translating user input into actions the operating system can perform.
- **Scripting Environment**: Offers a scripting language for automating tasks, enhancing productivity and allowing complex operations to be scripted.

## Common Types

### Terminals
- **xterm**: A standard terminal for the X Window System, usually used on UNIX-like operating systems.
- **iTerm**: A terminal emulator for macOS that offers features like tabs and split panes.
- **Terminal.app**: The default terminal emulator included with macOS.
- **xterm**: A foundational terminal for the X Window System, offering a basic interface for interaction with the shell.
- **iTerm2**: A feature-rich terminal emulator for macOS, known for its customizability and advanced features like split panes.
- **Terminal.app**: macOS's default terminal emulator, balancing functionality with macOS integration.

### Shells
- **Bash (Bourne-Again SHell)**: The default shell on many Linux distributions and macOS until Catalina.
- **Zsh (Z Shell)**: Extends Bash with additional features and themes, becoming the default shell on macOS starting from Catalina.
- **Fish (Friendly Interactive SHell)**: Designed to be interactive and user-friendly, it is not POSIX compliant but offers great features like autosuggestions.
- **Bash**: Widely used for its scripting capabilities and as the default shell in many environments, known for its balance of functionality and portability.
- **Zsh**: Offers extended features over Bash, including themes and plugins, appealing to users seeking customization.
- **Fish**: Focuses on user-friendliness, with features like autosuggestions and a web-based configuration interface.

## User Interface

### Terminal
- **Text-Based**: Usually a blank slate where text can be entered and displayed.
- **Customization**: Allows for changes in fonts, colors, and keyboard shortcuts.
- **Presentation Layer**: Where command-line interactions are visually presented, allowing users to input commands and view outputs.
- **Customization Options**: Users can personalize aspects such as font size, color schemes, and keyboard shortcuts to enhance usability.

### Shell
- **Prompt**: Typically displays a prompt where commands are entered.
- **Output**: Displays the output of executed commands, which can often be customized or color-coded for easier readability.
- **Command Line Prompt**: Displays a prompt awaiting user commands, offering feedback and results based on the executed commands.
- **Output Formatting**: Supports customizing the presentation of command outputs, which can be tailored for better readability or information highlighting.

## Conclusion
Understanding the difference between a terminal and a shell can help users effectively navigate and execute tasks on their system. While they are closely related, the terminal provides the interface, and the shell interprets the commands, making each indispensable to command-line operations.

The terminal and shell, while often mentioned together, serve distinct roles in the user's interaction with their computer's operating system. The terminal provides the user interface, and the shell interprets and executes the commands. Understanding these components enhances one's ability to perform and automate tasks efficiently, making it fundamental knowledge for navigating the command-line world.
Loading

0 comments on commit 264b0f2

Please sign in to comment.