| |
|
term -- Bashing around in Linux
Some neat tricks and How-Tos concerning that "command Box" thingy known as an xterm.
Now -- I know some of you folks may be playing around with rxvt or an eterm or
some other little side-dish, but most of the following will likely still apply.
- Running Programs from an xterm
Why would you want to? Well, if there's a program you just installed, it's
the best way to test it. If an app won't run when you click on a
menu item or a shortcut you usually don't know what's going on. But run
it from a "term" window,
and you may soon be enlightened.
Any decent program is going to include error handlers in the code
that send messages to stderr or stdout. And guess what --
you see that output in an xterm.
For example, the beginning of my FONTpage program checks for a few things before
getting down to business. Before it would become visible it might be sending the following
messages to stderr:
"pyGTK version 2.6 or greater is required for this application"
"Cannot load Pango"
"You need FontConfig to run FONTpage"
And then there are checks for commanline parsing . . . Missing libraries and other support files
are tough to find out about if you do not resort to running apps from a term to test them.
It's usually just as simple as typing in the command to run the program.
- cut and paste
In an xterm?
You bet.
to paste:
copy a string of words from somewhere on your system -- and paste it into the xterm.
Don't use <ctrl>V though -- use <Shift><Insert>
To copy from an xterm:
simply select the text.
Then paste it into another program (for instance, in Nedit,
the text editor I use all the time) via a middle-button click or (if emulating 3-buttons) click left and right
mouse buttons at the same time. (Normal paste Ctrl+V will not work.)
- Repeating commands
Another way I've saved tons of time is by repeating old commands.
While in a term, clicking the Up Arrow key will show the last command entered.
Up again will display the second to last command -- and so on. Go back
as many commands as you want -- usually as much as a couple hundred . . to move back to
more recent commands use the down arrow. When you are at the command you want,
just hit Enter
- Print an xterm
Sure you can, and without any fancy cutting or pasting . . .
because an xterm has Menus. The option to print appears
in the general menu, which you bring up by holding down the
<Ctrl> key and clicking the Left Mouse Button.
To access the FONTS MENU you down the
<Ctrl> key and clicking the Right Mouse Button.
- I think I did something wrong --
You entered something and suddenly output keeps streaming out nonstop, or you lost your prompt and
there is nothing you can do.
Sounds like you started a process that is running endlessly or will not return.
Now, while closing the xterm should stop that process -- that is rather extreme, and simply a
waste of time if you're going to try again. Instead, if such a problem arises,
stay calm, (and don't look aound to give anyone a clue) -- simply, casually
press <Ctrl>+C
That will stop whatever process you started and return you to the prompt.
- So much text, it's tough to read. (Clear the term) --
You could type clear and then Enter, and that would give you a clean window with just the prompt.
But what is easier is to just type:
<Ctrl>+L
- All done with your xterm?
Press <Ctrl>+D
|