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.
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.
A zero-dependency, ultra-lightweight database time machine for SQLite
An open-source, zero-dependency SQLite debugging tool that tracks database changes and allows instant rewinding to any previous state via snapshots, a web UI, and a CLI watcher daemon.
Tasks.txt
Tasks.txt is a plain text task manager for macOS.