wjsullivan.net

Overloading the Machine

NotesBash

Notes

History

!* 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.
grep -v Shows lines that don't match the pattern

Example of find using -exec:

find . -type f -exec file ’{}’ \;

Using History Interactively

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.

Make complex directory trees: mkdir -p foo/{cur,new,tmp}.

Completion

Add to ~/.bashrc:

# Use bash-completion, if available
if [ -f /etc/bash_completion ]; then
  . /etc/bash_completion
fi

This page was last modified on 2009 April 08. "NotesBash" by John Sullivan is Copyright ©2003, 2004, 2005, 2006, 2007, 2008, and licensed under the Creative Commons Attribution-Share Alike 3.0 United States License.