Display command options without typing --help

<Ctrl+o>
Type out the command and simply press to see the list of options for that command without having to type --help.
Sample Output
$ ssh <Ctrl+o>
usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
           [-i identity_file] [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path]
           [-w local_tun[:remote_tun]] [user@]hostname [command]

$ service <Ctrl+o>
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]

-7
By: bugmenot
2011-08-19 00:09:53

What Others Think

Seems only works for emacs mode of bash
nonoob · 786 weeks and 3 days ago
yes-yes, this only works if you use the emacs mode in bash.
davidpgero · 786 weeks and 2 days ago
doesn't work for most commands, hence useless most of the time.
gerard · 786 weeks and 2 days ago
Should read "execute and re-edit." Great for when you're working on commandline-fu that takes a couple test runs before getting it right.
h3xx · 786 weeks and 2 days ago
Just as pressing "Enter" key.
totti · 786 weeks and 2 days ago
Nice to know this "execute and re-edit", but definitely a misleading explanation here. If you don't know what it really does, it could even be dangerous. I *might* upvote this with a different explanation, but as it is I'm going to downvote, sorry :)
wipu · 786 weeks and 2 days ago
Ah, a Bash-ism using emacs mode. Gotta love non-portable commands.
atoponce · 786 weeks and 2 days ago
does not work in /bin/sh , /bin/bash nor /bin/tcsh
Mozai · 786 weeks and 2 days ago
very good tip
kev · 785 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

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.

Share Your Commands



Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: