You could use script (use -f to make sure it flushes every time) and you can have all the output in a file.
Use a terminal multiplexer (screen, tmux etc). For instance, for screen
http://web.mit.edu/gnu/doc/html/screen_11.html#
Command: copy Enter copy/scrollback
mode. This allows you to copy text
from the current window and its
history into the paste buffer. In this
mode a vi-like full screen editor is
active, with controls as outlined
below.
Other terminal multiplexers surely have more advanced capabilities.
Most terminal programs like xterm, urxvt, gnome-terminal have an option to change the starting working directory of the shell.
If you are using gnome-terminal, there is a special command line switch you have to provide to start the shell in a user defined directory. The command line switch I'm talking about is
--working-directory=DIRNAME
You should take a look at the manual pages of gnome-terminal to verify this.
So, if you want to make a desktop shortcut, the command you have to enter would be:
gnome-terminal --working-directory=/home/you_username/Dropbox/GTD
Beforehand feel free to test the command in your current terminal session.
For users on Linux Mint, follow these instructions
- Right click on the Desktop
- Select "Create Launcher"
- Name this shortcut with whatever name you want
- In the Command field, enter
gnome-terminal --working-directory=XXX
. Make sure to replace XXX
with the directory you want it to go to (see the example above)
Best Answer
or, you can use backticks, like
So:
Either way, what happens is the command
pwd
gets executed, then its return text gets passed as the command-line. A good way to see what's happening, assuming you're using bash, is to issueset -x
then run your command. As this example, wheresubl
is aliased toecho
shows, the result ofpwd
is passed on the command-line to the expanded alias (lines beginning with+
indicate the actual command being executed):(When you're done, you can stop printing commands by issuing
set +x
.)