Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
wackfordjf3
on Nov 21, 2011
|
parent
|
context
|
favorite
| on:
What's the one Linux command you wish you knew yea...
In bash: cp /dir/dir/dir/dir/filename !#:^:h/newfilename (Applies to more than cp) Strips cp & repeats previous dir tree minus /filename, plus /newfilename.
This can be mimicked by brace expansion: cp /dir/dir/dir/dir/{filename,newfilename}
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
This can be mimicked by brace expansion: cp /dir/dir/dir/dir/{filename,newfilename}