TWiki> Main Web>TechTips? >BashTips (14 Feb 2003, MattWalsh)EditAttach

How do I move around/edit in the bash prompt?

ESC f forward a word
ESC b backward a word
ESC d delete till end of current word
Ctrl-u deletes from cursor to beginning of line
Alt-backspace delete to beginning of next word
Ctrl-k delete from cursor to end of line
Ctrl-y paste in last thing deleted
ESC . paste in last word from previous command
Ctrl-l clear screen
ESC ? lists possible completions (same thing as second tab press)

Weird misc stuff

ALT-{ puts bracketed list of everything in the current dir on the prompt

What are the filename wildcards/globbing rules?

Metacharacter(s) Meaning
* Matches string of 0 or more chars
? Matches exactly 1 char
[abc...] / [!abc...] Matches any of specified chars / any char not specified
[a-z] / [!a-z] Matches any char in range / any char not in range
~ home dir of current user
~+ current working dir (MattWalsh: same as '.', no?)
~- previous working dir

What are the redirection rules?

>file / >>file redirects stdout stream to file / ditto but appends if file exists
2>file / 2>>file redirects stderr stream to file / ditto but appends if file exists
&>file redirects stdout and stdout streams to file
<file makes the stdin stream come from file
<<text makes the stdin stream come from file

See also...

Cute reference card

-- MattWalsh - 04 Aug 2002

Topic revision: r2 - 14 Feb 2003 - 04:09:00 - MattWalsh
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback