C-x C-e will open the command line in $EDITOR.
!* |
Designates all arguments of the preceding command. |
!^ |
Designates the first argument of the preceding command. |
!$ |
Designates the last argument of the preceding command. |
^la^t |
Replaces the -la options with -t in the preceding command. |
sudo !! |
Execute the previous command with sudo. |
!whatever:p| Show but don't execute the last command that starts with whatever.
!!:gs/foo/bar |
Execute the last command, replacing all instances of foo with bar. |
-n |
Go n events back |
:n |
reference a word number |
:p |
just print the event |
!50- foo |
run command 50 replacing the last argument with "foo" |
grep -v |
Shows lines that don't match the pattern |
cp foo{,.bak} |
Make a backup of foo. |
Example of find using -exec:
find . -type f -exec file ’{}’ \;
Stick the job in the background (ctrl-Z then "bg") then detach it from the terminal (in bash, "disown -h %[jobid]"). You may then close the terminal.
Add to ~/.bashrc:
# Use bash-completion, if available if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi
M-{} |
Include all expansions. Also can do things like mkdir -p foo/{cur,new,tmp}. |
bind -P will show keybindings.
Well, anyway, I was reading this James Bond book, and right away I realized
that like most books, it had too many words. The plot was the same one that
all James Bond books have: An evil person tries to blow up the world, but
James Bond kills him and his henchmen and makes love to several attractive
women. There, that's it: 24 words. But the guy who wrote the book took
*thousands* of words to say it.
Or consider "The Brothers Karamazov", by the famous Russian alcoholic
Fyodor Dostoyevsky. It's about these two brothers who kill their father.
Or maybe only one of them kills the father. It's impossible to tell because
what they mostly do is talk for nearly a thousand pages. If all Russians talk
as much as the Karamazovs did, I don't see how they found time to become a
major world power.
I'm told that Dostoyevsky wrote "The Brothers Karamazov" to raise
the question of whether there is a God. So why didn't he just come right
out and say: "Is there a God? It sure beats the heck out of me."
Other famous works could easily have been summarized in a few words:
* "Moby Dick" -- Don't mess around with large whales because they symbolize
nature and will kill you.
* "A Tale of Two Cities" -- French people are crazy.
-- Dave Barry
This page was last modified on 2012 August 12. "NotesBash" by John Sullivan is Copyright ©2003 - 2011, and licensed under the Creative Commons Attribution-Share Alike 3.0 United States License.