Files
system-programming/exercises/coreutils/README.md
Fabio Scotto di Santolo cc8ddf6ebd Write a simple UNIX ls clone
2025-09-19 17:08:57 +02:00

1.1 KiB

🛠️ Coreutils Reimplementations

This directory contains reimplementations of classic GNU Coreutils commands in C,
using only POSIX system calls and the standard C library.

The goal is to gain hands-on experience with Linux system programming, while practicing
error handling, portability, and clean coding.


📂 Structure

Each command is implemented in its own folder:


coreutils/
├── ls/        # list directory contents
├── cat/       # concatenate files
├── cp/        # copy files
├── echo/      # echo a string
├── sleep/     # wait X millis

Each subfolder contains:

  • main.c → source code
  • Makefile → to build the command

🎯 Learning Objectives

  • Practice file and directory operations
  • Reinforce knowledge of system calls: open, read, write, stat, opendir, unlink, link, etc.
  • Develop robust error handling
  • Understand the UNIX philosophy: small tools, combined power

⚙️ Build & Run

Example (ls):

cd ls
make
./ls .

Last updated: 2025-09-18