Re:Top Ten One-Liners from CommandLineFu Explained
by colonhyphenp on Thursday March 18, 2010 @09:08AM
(#1201149)
Last year a friend taught me about the bash trick "CTRL-R" <start typing 'ssh' or some other previously run command> on the command line for reverse history searching, and it is an amazing time saver. It acts as a great alternative to #8, "Find the last command that begins with “whatever,” but avoid running it"
Re:Top Ten One-Liners from CommandLineFu Explained
by erlanger on Thursday March 18, 2010 @09:40AM
(#1201239)
How do you reverse the search? <S-C-R> didn't do it for me. Either way this could be a good substitute for what I do now, tediously grepping .zsh/bash_history...
Re:Top Ten One-Liners from CommandLineFu Explained
by mziulu on Thursday March 18, 2010 @11:40AM
(#1201557)
If by reverse you mean going forward instead of backwards, that should be done with Ctrl-S; it does not work in Bash though, since Ctrl-S locks the scrolling of the terminal. I believe this behavior can be overridden, through some .xinputrc settings perhaps, but I haven't still found enough motivation to look it up!
Re:Top Ten One-Liners from CommandLineFu Explained
by sketerpot on Thursday March 18, 2010 @02:53PM
(#1202141)
When I need to do number one -- add sudo to the previous command -- I just use the up arrow, Ctrl-a to get to the beginning of the line, and add sudo. It's a little slower than the method in the article, but I find it downright dangerous to have something in your command history that means "do whatever was typed previously as root".
Re:Top Ten One-Liners from CommandLineFu Explained
by pvg on Thursday March 18, 2010 @08:05AM
(#1201044)
Couple of little nits - 5. and 8. are not bash specific and neither are event designators, these work fine in tcsh and zsh. I think caret substitution might have actually come from the *csh world. Not that big of a deal since bash is so prevalent these days but hey, a pedantipoint is a pedantipoint.
$ !whatever:p
edit: ok, I've found this: http://wiki.archlinux.org/index.php/Bash#History_search
http://www.catonmat.net/blog/the-definitive-guide-to-bash-co...
:w !sudo tee %
I've used vim for a long time, but didn't know about this one.
Is there a way to use a better codec?
The output codec? Use `-vcodec <format>`, where <format> is a video coded output by `ffmpeg -formats`.
Update: The whole comment about kbit/s was actually unnecessary, so I edited the article and replaced it with a better comment.
$ ls a b c
a b c
$ ls !$
ls c
c
$ ls a b c
a b c
$ ls !:3 !:2 !:1 !:0
ls c b a ls
ls: ls: No such file or directory
a b c
$