# How to List Files and Directories in Bash to Navigate the AI-For-Beginners Repository

> Master listing files and directories in bash with ls command options. Easily navigate the microsoft AI-For-Beginners repository and find essential files like curriculum and examples.

- Repository: [Microsoft/AI-For-Beginners](https://github.com/microsoft/AI-For-Beginners)
- Tags: how-to-guide
- Published: 2026-07-03

---

**Use the `ls` command with options like `-l`, `-a`, and `-R` to explore the microsoft/AI-For-Beginners repository structure and locate curriculum files, examples, and configuration files from the command line.**

When working with the microsoft/AI-For-Beginners repository locally, you must know how to list files and directories in bash to navigate its multi-layered curriculum structure. This guide covers the essential `ls` commands and flags that reveal lesson directories, example scripts, and configuration files directly from the terminal.

## Essential Bash Commands for Listing Files

The `ls` utility provides multiple options for viewing file contents and metadata. Below are the specific flags used to examine the AI-For-Beginners repository structure.

### Basic Directory Listing with `ls`

Running `ls` without arguments displays names of files and directories in the current folder, sorted alphabetically. When executed from the repository root, this reveals the top-level structure including `lessons/`, `examples/`, `binder/`, `translations/`, and key files like [`README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/README.md) and [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml).

### Viewing Detailed File Metadata

Add the `-l` flag to display permissions, owners, sizes, and timestamps in long format. Combine with `-h` to produce human-readable sizes (e.g., `1K`, `2M` instead of bytes).

```bash
ls -lh

```

Sample output from the repository root:

```

drwxr-xr-x  5 user  staff   160 Sep  3 12:00 etc
drwxr-xr-x 12 user  staff   384 Sep  3 12:00 lessons
-rw-r--r--  1 user  staff   823 Sep  3 12:00 README.md
-rw-r--r--  1 user  staff  1234 Sep  3 12:00 environment.yml

```

### Recursive and Hidden File Discovery

Use `-R` to recursively list sub-directories, essential for exploring nested structures like `etc/quiz-app/` and `lessons/`. Use `-a` to include hidden entries such as `.gitignore` and the `.devcontainer/` directory.

```bash
ls -R etc/quiz-app/
ls -a

```

## Navigating the AI-For-Beginners Repository Structure

These specific workflows target the repository's organization, helping you locate curriculum content and resources.

### Listing Curriculum Directories

To inspect only the lesson folders without individual files, use the directory filter:

```bash
ls -d lessons/*/

```

This reveals folders such as `lessons/0-course-setup/`, `lessons/1-Intro/`, and `lessons/4-ComputerVision/`. Each directory contains a [`README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/README.md) outlining lesson objectives, such as the Computer Vision overview located at [`lessons/4-ComputerVision/README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/lessons/4-ComputerVision/README.md).

### Locating Python Example Scripts

The `examples/` directory contains runnable demonstrations. Filter for Python files specifically:

```bash
ls examples/*.py

```

Output includes [`01-hello-ai-world.py`](https://github.com/microsoft/AI-For-Beginners/blob/main/01-hello-ai-world.py), [`02-simple-neural-network.py`](https://github.com/microsoft/AI-For-Beginners/blob/main/02-simple-neural-network.py), and `03-image-classifier.ipynb`. Documentation for these scripts resides in [`examples/README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/examples/README.md).

### Exploring the Quiz Application

The Vue.js-based quiz application lives in `etc/quiz-app/`. View its complete structure recursively:

```bash
ls -R etc/quiz-app/

```

This displays [`package.json`](https://github.com/microsoft/AI-For-Beginners/blob/main/package.json), source code under `src/`, and build scripts. The entry point is documented in [`etc/quiz-app/README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/etc/quiz-app/README.md).

## Advanced File Filtering Techniques

Combine `ls` with other utilities to pinpoint specific resources within the repository.

### Searching for Jupyter Notebooks

When searching for notebook files across the entire curriculum, pipe recursive output to `grep`:

```bash
ls -R | grep -i '\.ipynb$'

```

This surfaces files like `lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb` without manually browsing each folder.

### Sorting by Size and Modification Time

Use `ls -lS` to sort by file size (largest first) or `ls -lt` to sort by modification time (newest first). These flags help identify recently updated lessons or large dataset files within the curriculum.

```bash
ls -lS lessons/4-ComputerVision/
ls -lt

```

## Summary

- Execute `ls -lh` to view human-readable file sizes and permissions for [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) and [`README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/README.md)
- Run `ls -d lessons/*/` to list only curriculum directories without files
- Use `ls -R etc/quiz-app/` to explore the nested quiz application structure
- Combine `ls -R | grep -i '\.ipynb$'` to locate Jupyter notebooks across the repository
- Apply `ls -a` to reveal hidden configuration files like `.gitignore` and `.devcontainer/`

## Frequently Asked Questions

### How do I list only directories in the AI-For-Beginners repository?

Use the command `ls -d */` to display only directories, or `ls -d lessons/*/` to specifically target the lesson folders. This filters out files and shows you the curriculum structure at a glance, revealing paths like `lessons/0-course-setup/` and `lessons/4-ComputerVision/`.

### How can I find all Jupyter notebooks in the repository using bash?

Run `ls -R | grep -i '\.ipynb$'` to recursively list all files and filter for notebook extensions. This reveals learning materials like `lessons/3-NeuralNetworks/03-Perceptron/Perceptron.ipynb` without manually browsing each folder.

### What command shows hidden files like .gitignore in the repository?

Execute `ls -a` to include hidden entries starting with a dot. This reveals configuration files such as `.gitignore` and the `.devcontainer/` directory that are necessary for setting up the development environment.

### How do I check file sizes before cloning or downloading the repository?

Use `ls -lh` to display human-readable file sizes (e.g., `1K`, `2M`) alongside permissions. This helps you verify that files like [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) and dataset files in `lessons/` are present and assess their storage requirements.