I am working on macos and on the terminal app I am connecting to a server which run on linux, through ssh -X (and I actually I should not be allowed to install any software on it).
In order to save time, I would like to set an alias, thus a keyboard shortcut, to copy the current directory path directly to the clipboard, instead of writing pwd and the manually copying the output.
On local, on the .bashrc on my mac locally I have found and using this:
alias pcd='pwd | pbcopy'
but it does not work on the ssh server if I copy this on the .bashrc file of the remote machine.
I was thinking that I could use an alias to write pwd to remote terminal's output but then I do not know how to copy it to the clipboard.
Please not that I want to be able to paste the path of the directory to the remote machine terminal, even if once is copied on the clipboard it should work in both directions I guess, (unless the remote machine has its own clipboard).
Actually I also don't know it there would be any difference in the procedure if I would be working on linux pc instead of apple?