apputils
is a collection of shell functions to find application bundle
paths.
Available for POSIX shells (e.g. bash
, ksh
, zsh
) and fish
.
Built on mdfind
.
Note
This utility is meant to only be run on macOS.
Before using apputils
, ensure you have:
To directly source the scripts and use their functions in your environment:
$ . /path/to/repo/app.sh
$ appdir 'Docker'
If you have brew
installed, just run:
$ brew install Neved4/tap/apputils
Otherwise, clone the repository or download the script files directly:
$ git clone https://github.com/Neved4/apputils.git
Navigate with cd
into the project directory and then run:
$ ./install.sh
The following options are available:
usage: app command [options] <app>
Options:
-i Perform case-insensitive matching
Commands:
list List all installed apps.
find List application full path.
dir List application parent directory.
When added to your shell profile, the following functions are in your environment:
applist List all installed apps.
appfind List application full path.
appdir List application parent directory.
List all installed application bundles:
$ app list
Find the path of the application bundle, case-insensitive:
$ app find -i 'Docker'
Retrieve the directory containing the application bundle:
$ app dir 'Docker'
Call the former commands as functions in your shell profile:
$ applist
/Applications/Safari.app
/System/Applications/Notes.app
/System/Applications/Preview.app
$ appfind -i 'docker'
/Applications/Docker.app
$ appdir 'Docker'
/Applications
The app.sh script is compatible with ISO 9945:2009, also known as POSIX.1-2017.1
apputils
is licensed under the terms of the MIT License.
See the LICENSE file for details.
Footnotes
-
IEEE Std 1003.1-2017: Standard for Information Technology — Portable Operating System Interface (POSIX®), ISO/IEC/IEEE 9945:2009/COR 2:2017. URL: https://pubs.opengroup.org/onlinepubs/9699919799/ ↩