touch - A lightweight implementation of the Unix touch command for Windows
Summary
A lightweight Python implementation of the Unix touch command for Windows, enabling file creation and timestamp updates via command-line interface.
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
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.
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.
@realfxw: Who says terminal file managers can only rely on full keyboard shortcuts? Today, I found an amazing open-source project on GitHub: tfm-tui — a modern terminal file manager focused on mouse interaction (Mouse-First). It not only retains the lightweight and efficient features of terminals but also brings the smooth experience of modern GUI file managers into the terminal…
Introduction to the open-source project tfm-tui, a modern terminal file manager centered on mouse interaction, combining terminal efficiency with graphical interface intuitiveness.
Develop Cross-Platform CLI and GUI Tools With Tcl/Tk
Tcl/Tk is a toolkit for developing cross-platform command-line and graphical user interface tools.
Tau (GitHub Repo)
Tau is a terminal-based coding agent developed by Hugging Face, designed to assist with tasks like explaining code, adding tests, and fixing errors, while also serving as a teaching project for understanding coding-agent systems.