Example :
vim /etc/fstab
## damn
<ctrl+u>
sudo <ctrl+y>
## like a boss.
Example 2 :
sudo vim /root/bin/
##uh... autocomplete doesn't work...
<ctrl+u>
sudo ls /root/bin
##ah! that's the name of the file!
<ctrl+y> sudo vim /root/bin/ ##resume here! Thanks readline!
Next time you are using your shell, try typing
ctrl-x ctrl-e # in emacs mode
or
<ESC> v # in vi mode
The shell will take what you've written on the command line thus far and paste it into the editor specified by $EDITOR. Then you can edit at leisure using all the powerful macros and commands of vi, emacs, nano, or whatever.
Show Sample Output
This lets you use your favorite vi edit keys to navigate your term. To set it permanently, put "set editing-mode vi" in your ~/.inputrc or /etc/inputrc.
Enable readline even if the command line application is not using it. Show Sample Output
Assuming you've written all of
make -j hfst-tokenize && echo doavtter gr?dakursa|./hfst-tokenize --gtd tokeniser-gramcheck-gt-desc.pmhfst
and want that to execute every time you :w in vim (or C-xC-s in Emacs), just hit and it'll turn into
while true; do ( make -j hfst-tokenize && e doavtter gr?dakursa|./hfst-tokenize --gtd tokeniser-gramcheck-gt-desc.pmhfst ); inotifywait -q -e modify -e close_write *; done
with the cursor right before the ')'. Hit enter, and it'll run on each save.
Requires the package inotify-tools installed.
Show Sample Output
Use this if you're using vi editing mode.
Example use :
sudo vim /root/bin/ ##uh... autocomplete doesn't work... dd sudo ls /root/bin
##ah! that's the name of the file!
<p> sudo vim /root/bin/ ##resume here! Thanks readline!
after this command, only needs press ESC to edit command line.
In bash, by pressing ALT+n and then a character x, x will be printed n times I know is not the same as the original command, but is correlated. Show Sample Output
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: