using `!#$’ to referance backward-word
Here is something that I found on the commandlinefu
cp /work/host/phone/ui/main.cpp !#$:s/host/target
Ah well…its very interesting and very useful.
Some explanation:
!# – means the current command (similar to !! being the last command)
$ – represents the last parameter
:s – is used for substitution.
Related articles
- CommandLineFu: Amazing Collection Of Command Line Gems [Linux & Mac] (makeuseof.com)
- Oh, the Iron-y (ftalphaville.ft.com)
Tags: Alabama Android Market BNP Paribas Command-line interface Data Formats Document Type Declaration Document Type Definition FAQs Help and Tutorials html HTML element Iron ore Linux Mac OS X MakeUseOf makeuseof.com Markup language Normal backwardation Operating system Operating Systems TBWA\Chiat\Day ubuntu XHTML
Related Articles:
- 2010/07/20 Linux command to repeat a string n times - Super User
- 2011/01/05 Shell Scripting
- 2010/11/25 Make any command read line enabled (on *nix)
- 2010/11/19 Screen enable/disable logging in all windows
- 2010/09/04 Remove some path from the PATH variable temporarily.
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.