# Common Bash Command for Viewing Directory Contents in AI‑For‑Beginners: Using `ls` to Navigate the Repository

> Learn the common bash command ls to view directory contents in AI-For-Beginners. Explore your repository with options like -lah and -R to understand project structure.

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

---

**The most common bash command for viewing directory contents is `ls`, which you can combine with options like `-lah` and `-R` to explore the microsoft/AI‑For‑Beginners repository structure.**

The microsoft/AI‑For‑Beginners repository is a comprehensive educational codebase containing Jupyter notebooks, Python scripts, a Vue 2.x quiz application, multilingual documentation, and configuration files across more than two dozen lesson directories. When exploring this large curriculum from the command line, you need a reliable way to inspect the directory tree before opening notebooks or installing dependencies.

## Why `ls` Is the Essential Command for This Repository

The `lessons/` folder alone contains 24 sub‑directories (e.g., `0-course-setup`, `1-Intro`, `4-ComputerVision`, `5-NLP`), each with Markdown outlines, notebooks, and lab instructions. Combined with `examples/`, `etc/quiz-app/`, and translation directories, the repository spans hundreds of files. The `ls` command provides the fastest shell‑native method to orient yourself without launching a GUI file manager.

## Navigating the Repository Structure with `ls`

### Inspecting Top‑Level Files

Start by viewing the repository root to locate key configuration files. In `AI-For-Beginners`, the top level includes [`README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/README.md) (the curriculum overview) and [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) (the Conda environment definition).

```bash
ls -lah

```

This command reveals:

- [`README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/README.md) – 12 KB curriculum overview
- [`environment.yml`](https://github.com/microsoft/AI-For-Beginners/blob/main/environment.yml) – 8 KB dependency specification
- `lessons/` – Directory containing the 24 lesson modules
- `etc/` – Configuration and quiz application files

### Exploring the lessons/ Directory Recursively

To verify that all lesson folders are present and see their internal structure, use the recursive option:

```bash
ls -R lessons/

```

This walks through `lessons/0-course-setup/`, `lessons/1-Intro/`, and subsequent directories, showing files like [`setup.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/setup.md), [`how-to-run.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/how-to-run.md), and assignment instructions.

### Listing Hidden Configuration Files

The repository contains hidden files such as `.gitignore` and dot‑directories. The `-a` flag exposes these:

```bash
ls -la

```

This is useful when verifying version‑control settings or examining the Vue.js quiz application configuration in `etc/quiz-app/`.

## Practical `ls` Options for Data Scientists

### Long Format and Human‑Readable Sizes

When checking data assets like archived datasets, combine the long format with human‑readable sizes:

```bash
ls -lh lessons/4-ComputerVision/

```

The `-l` flag displays permissions, ownership, and timestamps, while `-h` converts bytes into KB or MB, helping you gauge file sizes before opening them.

### Sorting by Modification Time

To identify the most recently edited lesson or quiz files, sort by time:

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

```

This lists the Vue 2.x quiz application files with the newest modifications first, useful when tracking recent changes to the interactive components.

### Recursive Filtering for Jupyter Notebooks

To count or locate specific file types across the entire tree, pipe recursive `ls` output to `grep`:

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

```

Alternatively, use `find` for a cleaner path‑based search:

```bash
find . -name '*.ipynb' | wc -l

```

This returns the count of notebook files (42 in total) distributed across the curriculum.

## Summary

- **`ls`** is the standard bash command for viewing directory contents in the `AI-For-Beginners` repository.
- Use **`ls -lah`** to see human‑readable file sizes and hidden configuration files at the top level.
- Apply **`ls -R`** to traverse the `lessons/` directory and verify all 24 lesson folders are present.
- Combine **`ls -lt`** with specific paths to track recent modifications in the `etc/quiz-app/` Vue application or lesson directories.
- Filter recursive listings with **`grep`** to isolate Jupyter notebooks (`.ipynb`) or Python scripts before launching your development environment.

## Frequently Asked Questions

### What is the difference between `ls` and `ls -a`?

The `ls` command hides files and directories starting with a dot (`.`), such as `.gitignore` or `.github`. Using `ls -a` reveals these hidden entries, which is essential when examining repository configuration files in `AI-For-Beginners`.

### How do I view directory contents with file sizes in a human‑readable format?

Append the `-h` flag to your command, typically combined with `-l` for details: `ls -lh`. This displays sizes in KB, MB, or GB instead of raw bytes, making it easier to assess large data files or notebook checkpoints.

### Can I list files recursively in bash without using `find`?

Yes. The `ls -R` command recursively lists subdirectories. For the `AI-For-Beginners` curriculum, running `ls -R lessons/` displays all lesson modules and their contents, though for complex filtering (like searching by extension), `find . -name '*.ipynb'` is more precise.

### How do I sort directory contents by the most recently modified files first?

Use the `-t` option: `ls -lt`. This sorts entries by modification time, placing the newest files at the top. This is particularly useful when checking which lesson or quiz files were updated most recently in the repository.