A while ago, I moved from a purely Windows environment to using Windows and a Mac.
Whilst I am slowly getting used to my Mac and loving it, there are a few things that frustrate me.
One of them is the fact that there is only 1 working directory on the filesystem.
That may seem odd to those only ever run Unix, but follow this as my experience on Windows.
I have C: (programs), D: (data), E: (CD/DVD) and F: & G: (USB keys).
If I type ...
CD /D F:\Dir1\Dir2
CD /D D:\Dir3\Dir4
F:
CD
D:
CD
assuming that those are all valid paths, the output will be ...
F:\Dir1\Dir2
D:\Dir3\Dir4
This shows I can swap between "drives" and I get the last working directory per drive.
This is really useful when you want to copy content from one drive to another, without having to type the entire path.
You can go to the directory, verify its contents, switch to the destination drive/directory and then initiate the copy ...
COPY F:*.* D:.
for example.
When it comes to my Mac, whilst I could use the UI with 2 Finder tabs, I would still like to be able to to use the command line.
Is there an equivalent way of having a mounted filesystem remember and expose the last working directory on that filesystem?
At the moment it is the "type the entire command out completely" approach.
cd /one/path; cd /second/path; cp $OLDPWD/* .
/share/
as local and/share/
mounted from NAS should be equivalent, so no, because it breaks philosophy. But you can usepushd
/popd
like HBruijn suggests, or do better -- write a shell script and keep your paths as variables.*.*
in Unix is any file with at least one dot, in Microsoft's windows it is any file.*.*.*
is any file with 2 dots, Windows with one dot.*.*.*.*
file with 3 dots, Windows file with 2 dots. etc.cp e: f:
If you havecp /path/to/file /path/to/directory
then it is repeatable.