Bash has a really convenient way to get to that argument. You can use !$ which refers to the last argument in the preceding command.
Consider:
$ pwd
/home/me
$ cp blah.txt /some/other/location
$ cd !$
$ pwd
/some/other/location
And, since you probably only want to be there temporarily you can push the directory on the stack and pop out when you are done.
$ pwd
/home/me
$ cp blah.txt /some/other/location
$ pushd !$
$ pwd
/some/other/location
$ popd
$ pwd
/home/me
L7Sqr
Practically a Posting Shark
851 posts since Feb 2011
Reputation Points: 253
Solved Threads: 155
Skill Endorsements: 7
Question Answered as of 1 Year Ago by
Fest3er
and
L7Sqr