Add functions.md and category

This commit is contained in:
Marcel Bischoff 2015-12-04 00:21:31 +01:00
parent 56acd45232
commit 2074d145c9
2 changed files with 36 additions and 0 deletions

View File

@ -39,6 +39,7 @@ For more terminal shell goodness, please also see this list's sister list [Aweso
- [Metadata Files](#metadata-files) - [Metadata Files](#metadata-files)
- [Opening Things](#opening-things) - [Opening Things](#opening-things)
- [Fonts](#fonts) - [Fonts](#fonts)
- [Functions](#functions)
- [Hardware](#hardware) - [Hardware](#hardware)
- [Hardware Information](#hardware-information) - [Hardware Information](#hardware-information)
- [Power Management](#power-management) - [Power Management](#power-management)
@ -611,6 +612,11 @@ atsutil server -ping
``` ```
## Functions
Please see [this file](functions.md).
## Hardware ## Hardware
### Hardware Information ### Hardware Information

30
functions.md Normal file
View File

@ -0,0 +1,30 @@
<img src="https://cdn.rawgit.com/herrbischoff/awesome-osx-command-line/master/assets/logo.svg" width="600">
# Functions
> An assorted collection of useful OS X specific Bash-style functions. Part of [Awesome OS X Command Line](https://github.com/herrbischoff/awesome-osx-command-line).
## Table of Contents
- [Finder](#finder)
## Finder
### Get Path of Frontmost Finder Window
```bash
function finder_path {
osascript -e 'tell application "Finder"'\
-e "if (${1-1} <= (count Finder windows)) then"\
-e "get POSIX path of (target of window ${1-1} as alias)"\
-e 'else' \
-e 'get POSIX path of (desktop as alias)'\
-e 'end if' \
-e 'end tell';
}
```
## License
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.