Monday, July 5, 2010

!* trick:-

$cd /digit/long/path/pain/to/type/again

bash: cd: /home/zodiac/long/path/pain/to/type/again: No such file or directory

mkdir -p !* => mkdir -p /home/zodiac/long/path/pain/to/type/again

beloroin:-

I know that

$>!#

Executes the command found at # in your history and

$>!ba

Would execute the last command that starts with "ba", and that

$>ping !$

pbhj


where did you learn this?

How do you find the man page for ! or :

!?

mhallbiai

pbhj,

! is an event designator used in history expansion for bash.
there is a wealth of documentation for bash.
that just scratched the surface...
Code:
man bash
you can search the man pages for 'event designators' and it will bring you directly to ! paging up from there will explain HISTORY EXPANSION

: is a under SHELL BUILTIN COMMANDS discussed after !

hope this helps

many happy hours of reading

No comments:

Post a Comment