Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/proprietary/macos-trash

CLI utility to send files to macOS Finder trash can (macOS Sonoma 14.5)
https://github.com/proprietary/macos-trash

command-line command-line-interface command-line-tool macos macosx objective-c trash trashcan

Last synced: about 16 hours ago
JSON representation

CLI utility to send files to macOS Finder trash can (macOS Sonoma 14.5)

Awesome Lists containing this project

README

        

``trash`` for macOS
~~~~~~~~~~~~~~~~~~~~

This is a simple utility to send files to macOS's Trash from the command line.

This works on macOS Sonoma 14.5 (June 2024).

Download and install binary release
---------------------------------------

.. code-block:: bash

curl -fSLO https://github.com/proprietary/macos-trash/releases/download/v1.0.0/trash
sudo install ./trash /usr/local/bin

Usage
-------

.. code-block:: bash

cd /tmp
echo "hello world" > hello-world.txt
trash hello-world.txt

This works on directories or regular files. I suggest using
``trash`` anywhere you would have used ``rm(1)``.

Currently, this command line tool cannot restore files. You will have
to open Trash in Finder and restore it from the GUI.

Building manually
-------------------

Build
=====

.. code-block:: bash

xcode-select --install
git clone https://github.com/proprietary/macos-trash
cd macos-trash
make
make test
sudo make install

Verify installation
===================

.. code-block:: bash

trash --version

License
--------

Apache-2.0