A recreation of the Unix ls command, built from scratch in C as part of the WeThinkCode curriculum.
This project implements a functional version of the standard Unix ls command, supporting multiple flags and options for listing directory contents in various formats. It demonstrates fundamental C programming concepts including file I/O, memory management, data structures, and system calls.
- GCC compiler
- Make
- Unix-like environment (Linux, macOS, etc.)
Clone the repository and navigate to the project directory:
git clone https://github.com/MikeFMeyer/ft_ls
cd ft_ls/makeThis will compile the project and create the ft_ls executable.
./ft_ls [OPTIONS] [file ...]| Flag | Description | Bonus |
|---|---|---|
-A |
Show all files (including hidden), but exclude . and .. |
✓ |
-G |
Add color output to file listings | ✓ |
-R |
Recursively list contents of directories | |
-a |
Show all files, including . and .. |
|
-f |
Show files unsorted | ✓ |
-l |
Use long listing format | |
-n |
Display UID and GID as numbers in long format | ✓ |
-p |
Append / indicator to directories |
✓ |
-r |
Reverse sort order | |
-t |
Sort by modification time instead of name |
# List current directory with colors
./ft_ls -G
# List all files in long format, sorted by time
./ft_ls -lt
# Recursively list with colors
./ft_ls -GR
# List with directory indicators
./ft_ls -psrcs/- Source fileslibft/- Custom C library implementationincludes/- Header filesMakefile- Build configuration