Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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: