I am using the terminal quite a lot, but I am frustrated that I repeatedly resort to the mouse in the following situation.
I have two terminal tabs open with the current working directories X and Y, respectively. In the tab where the directory is X, I want to do this (as an example):
cp somefile Y
The path Y could be very long, so my current, and cumbersome, method is to do
- Ctrl+PgUp to change tab,
- write
pwd
to show Y, - use the mouse to select the output from
pwd
, - Ctrl+PgDown to go back to the first tab,
- use the mouse again to paste Y after
cp somefile
, using middle-click.
Surely this procedure must be avoidable, for example by having a shortcut that copies the current working directory without using the mouse. Any suggestions?
rsync
between them,cp
,diff
, running some command in one folder that pipes the output into the other, etc), and it is a recurrent issue I have that I need to type both paths (or the other) at the command line. It can be compared with having two panes open in Nautilus to allow drag-and-drop. Any suggestions on improving this workflow would be great!remote="path to the/remote directory/"
and thenmv this_file_here "$remote"
... but tab completion will then not work for subdirs of$remote
(that can be cured by tweaking bash's completion, but it's not the simplest). Another possibility (and very likely the simplest) is to soft link to the remote directory in your working dir:ln -s /path/to/remote/dir ./remote
and remove the link when you're done withrm remote
.