bind -x
was added in Bash 4.0 so this does not work with Bash 3.2 which comes with macOS.
menu-complete-backward
was added in Bash 4.1. This makes for example
M-s
insert the path of the first file in the current directory after a space when the word to be completed is empty.
!#
is the current line,
:$
is the last word, and
\e^
is
history-expand-line
.
This is useful for converting a piece of text from a browser or a PDF reader to Markdown.
pbpaste -Prefer rtf
no longer works for getting the rich text version of the clipboard.
markdown_strict
uses Markdown.pl syntax without Pandoc extensions.
--no-wrap
disables hard wrapping and
--atx-headers
uses ATX headers instead of SETEX headers. You can also use
osascript -e'get the clipboard as"HTML"'|sed 's/«data HTML//;s/»//'|xxd -r -p
to get an HTML version of the clipboard which is included for text copied from a web view in applications like Safari and Chrome.
This also works with Safari if you just change the application name. Replace
window 1
with
windows
to list the URLs of tabs in all windows instead of only the frontmost window. This also includes titles:
osascript -e{'set o to""','tell app"google chrome"','repeat with t in tabs of window 1','set o to o&url of t&"\n"&" "&title of t&"\n"',end,end}|sed \$d
.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: