!* # ... All parameters of the last command
!$ # ... Last parameter of the last command
!^ # ... First parameter of the last command
!:1 # ... First parameter of the last command
!-2:2 # ... Second parameter from 2 commands ago
!:2-3 # ... Previous command's parameters 2 to 3
!:2* # ... Previous command's parameters 2 onwards
!:2- # ... Previous command's parameters 2 onwards omitting last
!$:h # ... Last parameter, strip one level
!$:h:h # ... Last parameter, strip two levels
!?ls # ... Last 'ls' command
cd ~/projects/sample/src/main/java/com/arun/examples/
cd java scala
The last command will put you in ~/projects/sample/src/main/scala/com/arun/examples/
(Now that's Hot !)
r apple=orange
!!:s/apple/orange/ # ... Subst previous command replacing first 'apple' with 'orange'
!!:gs/apple/orange/ # ... Subst previous command replacing all occurrences of 'apple' with 'orange'
Edit variables on demand:
vared PATH 1 ↵
/bin:/home/sergio/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl