here’s the scenario
you are in bash
:~/dirA$ cd /dirb
:/dirb$ cp filex __here_i_want_trick_to_reference_dirA
example of a similar trick is cd -, which puts you into the previously visited directory.
I want this because, in reality, the paths I am dealing with are huge and I’m looking for a shortcut.
furthermore, a trick which handles this:
:a$ cd x
:x$ cd y
etc.
:y$ cp file _ref_to_original_dir_a
I am looking for the least intrusive way to accomplish this, if the 2nd part is not doable without too many shenanigans, then it’s probably not worth it for my usage.
thanks
just an update – thanks for the replies.
http://www.hccp.org/modding-cd.html
That page describes what i am choosing. it just adds the alias to the mix for the pushd solution.
This should be really easy to do with
pushd, anddirs.You simply have to issue the
pushdcommand in the directory you want to copy your files to, and use:You can find documentation on those builtin commands here, and examples of aliases to replace cd with them here.
For example: