osx-trash for Mac
A small collection of Mac OS X command line tools that I’ve developed over the years.
osx-trash — overview
tools-osx README
by Morgan Aldridge
OVERVIEW
A small collection of Mac OS X command line tools that I’ve developed over the years. Similar to the NextStep and Mac OS X commands open, pbcopy, and pbpaste, most of these tools are bash scripts created as an exercise to hone my bash-fu. There are also a number of Perl and Ruby scripts submitted by others.
TOOLS
clipcat
clipcat prints and concatenates Mac OS text clippings. Submitted by Daphne Preston-Kendal.
dict
dict performs a look-up in the Mac OS X dictionary. Note: unlike the other scripts provided, this one requires that you have MacRuby installed. Submitted by Daphne Preston-Kendal.
eject
eject ejects a volume or network volume and all other volumes on the same local device. A shorter, simpler, smarter wrapper of diskutil’s various eject/unmount options and allows specifying either a full path in /Volumes or just the volume name.
launch
launch searches for and launches applications. It's a slightly smarter wrapper for open -a with wildcard matching via Spotlight, if available, or find.
ql
ql opens files with the Mac OS X Quick Look feature.
swuser
swuser switches users using the Mac OS X Fast User Switching feature. You can either switch out to the login window or to another user. Note: unfortunately, this is not currently compatible with screen.
trash
trash allows trashing of files instead of tempting fate with rm. Correctly handles trashing files on other volumes, uses the same filename renaming scheme as Finder for duplicate file names, can list trash contents w/disk usage summary, and empty trash (including securely) w/confirmation. Does not require Finder to be running.
with
with sets the application with which specified documents will be opened. It can even change and open in one fell swoop. Submitted by Daphne Preston-Kendal.
INSTALLATION
Installing from Source
Installing all tools: Clone this repository or download and extract the tools. Run rake. Run rake install. (If you don't have write permission on /usr/local/bin, you'll need to prepend sudo.)
Installing one or more specific tools: Clone this repository or download and extract the tools. Run rake Run rake 'install[ql,trash]', specifying individual tools in a comma separated list between the square brackets. (If you don't have write permission on /usr/local/bin, you'll need to prepend sudo.)
Installing Using a zsh Plugin Manager
_Note: You cannot install clipcat, dict, or with using this method._
macOS 10.15 Catalina and newer now use zsh as the default shell. If you're using a zsh plugin manager, you can install individual tools as follows and they'll be automatically downloaded, installed, and kept up-to-date:
Using zinit: Add the following to your ~/.zshrc file for each tool you wish to install, trash, for example:
OTHER TOOLS
Looking for other Mac OS X-specific command line tools to complement these? Check out the following:
appswitch and launch by Nicholas Riley
Details
允许将文件移动到垃圾桶,而不是冒着使用 rm 的风险
How to install osx-trash
- Open Terminal (press ⌘ + Space and type “Terminal”).
- If Homebrew is not installed yet, run the command below first.
- Run this command:
Latest 10 releases
Last updated 2013-07-06; current version tools-osx-2011-06-02, with the latest 4 releases listed.
| Version | Released | Type | Size | macOS | Windows | Linux |
|---|---|---|---|---|---|---|
| tools-osx-2011-06-02 | 2013-07-06 | Stable | — | — | — | — |
| tools-osx-2011-02-25 | 2013-07-06 | Stable | — | — | — | — |
| tools-osx-2010-12-08 | 2013-07-06 | Stable | — | — | — | — |
| tools-osx-2010-10-26 | 2013-07-06 | Stable | — | — | — | — |
Data from GitHub Releases; stable releases first, each group sorted newest first.
Prebuilt bottle platforms
Official Homebrew bottles cover:
- all
⚠️ No prebuilt bottle for Intel Macs; Intel users need brew install --build-from-source to build from source.
Cannot be installed alongside: macos-trash, trash-cli, trash。
To use both, first brew uninstall the conflicting package, or install it in an isolated environment.
Compared with similar apps
Only public metadata is compared, with no subjective recommendation; see the compare pages for field-by-field comparisons.
| App | Version | License | Architecture | 30-day installs |
|---|---|---|---|---|
| osx-trash | tools-osx-2011-06-02 | MIT | CLI | 1 |
| vaulted | v3.0.0 | MIT | CLI | 1 |
| webarchiver | 0.13 | GPL-3.0-only | CLI | 1 |
| libxo | 2.3.0 | BSD-2-Clause | CLI | 3 |
Similar apps: Command-line Tools
vaulted
Spawn environments from securely stored secrets.webarchiver
Webarchiver allows you to create Safari .webarchive files from the command line.libxo
Allows an application to generate text, XML, JSON, and HTML outputconserver
Allows multiple users to watch a serial console at the same timecalm-cli
Architecture as Code (AasC) aims to devise and manage software architecture via a human and…npm-check-updates
npm-check-updates upgrades your package.json dependencies to the latest versions, ignoring…Categories: Command-line Tools