More on this book
Kindle Notes & Highlights
Tab completion can be used to autocomplete file names, directories, commands, arguments, and more.
To enable programmable completion on an Ubuntu system, source /etc/bash_completion. You can add this command to your personal initialization files
to run another command against the last item on the previous command line. To access that item in your current command, use "!$".
To run the most recent command that begins with a given string, use an exclamation mark followed by that string. For example, to run the last command that started with a "d", type "!d<ENTER>."
If you want to use the output of one command in another command line, use command substitution. You can perform command substitution by using backticks (`) to surround a command or a dollar sign followed by parenthesis that surround a command. Surrounding a command with backticks is the older style and is being replaced by the dollar sign syntax. The output of the command can be used as an argument to another command, to set a variable, or for generating the argument list for a for loop.
...more
When I need to perform the same action for multiple items, I use a for loop right from the command line.
it's really easy to repeat the previous command with superuser privileges. If sudo is configured on your system, run sudo !!, otherwise run su - c "!!".
The "!#" string represents the current command line. To reuse an item on the same command line follow "!#" with ":N" where N is a number representing a word. Word references are zero based, so the first word, which is almost always a command, is :0, the second word, or first argument to the command, is :1, etc.
I gave in and created an alias to compensate for my sloppy typing.