Mac command line niceties
I've made some additions to my .bashrc today based on this article. First, the usage:

Then I press any key (Return, Esc, Space, whatever), and...

I can also do this:

That is, I can open a finder window in the current directory just by typing open—no need to explicitly specify '.' as the argument.
Here's the code:
function ql () {
(qlmanage -p "$@" > /dev/null 2>&1 &
local qlmanage_pid=$!
read -sn 1
kill ${qlmanage_pid}) > /dev/null 2>&1
}
function open () {
if [ -z "$*" ]; then
/usr/bin/open .
else
/usr/bin/open "$@"
fi
}
About this entry
You’re currently reading “Mac command line niceties,” an entry on Kevin's random thoughts
- Published:
- November 9th 04:42 PM
- Updated:
- November 9th 04:42 PM
- Sections:
- tech
0 comments
Jump to comment form | comments rss [?]