touch - A lightweight implementation of the Unix touch command for Windows

Lobsters Hottest Tools

Summary

A lightweight Python implementation of the Unix touch command for Windows, enabling file creation and timestamp updates via command-line interface.

<p><a href="https://lobste.rs/s/lcbq86/touch_lightweight_implementation_unix">Comments</a></p>
Original Article
View Cached Full Text

Cached at: 08/24/26, 07:29 AM

rajtilakjee/touch

Source: https://github.com/rajtilakjee/touch

touch

A lightweight implementation of the Unix touch command for Windows, written in Python.

touch creates a file if it does not exist. If the file already exists, its timestamp is updated without modifying its contents.

Features

  • Create files from the command line
  • Update timestamps of existing files
  • Touch multiple files in a single command
  • Support file and directory paths
  • Continue processing remaining paths if one operation fails
  • Return a non-zero exit code when an operation fails
  • No runtime dependencies

Usage

Touch a single file:

touch hello.txt

Touch multiple files:

touch one.txt two.txt three.txt

Paths containing spaces can be quoted:

touch "hello world.txt"

Existing files are not overwritten. Their timestamps are updated instead.

Installation

Installation instructions will be added when the package is published to PyPI.

Development

This project uses uv for Python project and dependency management.

Clone the repository and run the command locally with:

uv run touch hello.txt

Run the help command with:

uv run touch --help

Requirements

  • Windows
  • Python 3.14 or later

Status

touch is currently in early development.

Version 0.1.0 implements the core touch functionality. Additional Unix touch options will be added in future versions.

Similar Articles

Text files as a user interface

Lobsters Hottest

This article explores the concept of using a text editor as a user interface for command-line programs, highlighting how it leverages the editor's full editing capabilities while remaining simple to implement, with examples like crontab -e and a custom image gallery tool.

@xiaofeilong99: Windows users, take note: Microsoft has released its own Coreutils. Commands like cat, cp, ls, mkdir, pwd, rm, sort, tee — which work perfectly on Linux/macOS but feel awkward on Windows — now have a native solution.

X AI KOLs Timeline

Microsoft has released Coreutils for Windows, a set of native Unix-style core tools (such as cat, cp, ls, etc.), aimed at reducing cross-platform script and development environment differences. It can be installed via WinGet and is currently in preview.

Tasks.txt

Product Hunt

Tasks.txt is a plain text task manager for macOS.