[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Newbie comments & queries



on Tue, Nov 06, 2001 at 05:42:51AM +0200, Ian Balchin (fables@imaginet.co.za) wrote:
> Hi, all,
> 
> My last post seemed to have evaporated into thin air.  Tere have been no 
> answers so imagine that you didn't see it either.
> 
> Dman, to answer you, I can print via lpr but nothing out of cat [file] > 
> /dev/lp0 _unless_ I print from root when it works.

If you'll look at /dev/lp0, you'll probably find it looks like:

    crw-rw----  1 root   lp      6,   0 Jul 20  1998 /dev/lp0

...which means it can only be written to by user root, or group lp.
Generally, you want to print using the lpr command.

> The lpr switch -i appears to do nothing for the margin. Thus,

I'm not familiar with this.

> # lpr -i6 myfile
> 
> gives no margin.
> 
> If I do (got out of Printing-Usage-HOWTO)
> 
> # pr myfile -o6 | lpr
> 
> then I can get a margin, but the lpr switch -i should also work.
> Could there be something somewhere overriding it? Have tried second 
> printer but same problem.

If you have a graphics-capable printer (earlier comments suggest you
don't), you can use the mpage or psnup commands to manipulate output.
E.g.:

    $ mpage -2 myfile | lpr

...will render you input two pages per physical sheet.  Roughly like:

    +----------------------+
    |+---------++---------+|
    ||         ||         ||
    ||         ||         ||
    ||         ||         ||
    ||         ||         ||
    ||         ||         ||
    |+---------++---------+|
    +----------------------+

...if you've got good eyes, it's a nice paper-saver.  Other options
allow printing as many as eight pages per sheet, mpage may be pipelined
to exceed this, e.g.:

    $ mpage -8 myfile | mpage -8 myfile | lpr

...would print your output 64 pages per sheet.  Using this technique,
the bash manpage may printed on two sheets of paper....

You can also save the output to a file for printing elsewhere (so long
as the other location can print postscript):

   $ mpage -2 < myfile > myfile.ps

> Once again tried the PS2 mouse, but it is dead and I think it is the
> motherboard.  That is the end of that. Probably at some time in its
> life the mouse was unplugged while live according to local computer
> shop.

Has the mouse been tried on another PC?  Yes, mobos do die, but you
could at least determine which end of the connection the problem's at.

> THE FIRST BOOK OF UNIX by Douglas Topham (1990) is the only book on
> the subject in the whole library service of the Eastern Cape Province
> here, so have that out at the moment.  They found one title on Linux
> also recorded, but cannot find it.  Lots of commands to try out.

Again, there are *tons* of useful docs available free of charge online,
including packaged into Debian as HOWTOs, man pages, and info documents.
A fully loaded Debian system has literally hundreds of volumes worth of
documentation on it.  If you can't store it all locally, it's also
available on the Web.

I hate to advocate piracy, but in your case the economic/access angle
may mitigate.  The O'Reilly UNIX CD Bookshelf is a six-book set of
O'Reilly publications on CDROM, browseable in HTML format.  Contents
are:

    UNIX in a Nutshell
    UNIX Power Tools
    Learning the UNIX Operating System
    Learning eth vi Editor
    sed & awk
    Learning the Korn Shell

Most of these are older and/or less applicable sets of docs (GNU/Linux,
bash, and Perl emphases would be better), but there's a large level of
overlap.  The first two texts were the ones I finally "got over the
hump" with WRT grokking Unix.  You might look at aquiring a copy of the
disk.  It's been known to float around the Web.  And you'll want to buy
all the O'Reilly books you can get your paws on afterwards (I have...).


> When I run top the processes dissapear off the bottom of the page.  I
> can find no key in the help to do this.  I nuked tty5 where I was
> running it when I tried to pipe top through more or less.

There are several alternative commands you can use.

'top' under Solaris, IIRC, would allow paging through the process list,
which was helpful.  GNU top doesn't offer this.

You can toggle display of processes -- the 'h' key will give you a list
of options you can run while doing 'top', notably display of idle
processes.

You can run a different command.

    $ ps aux | less 

...will list all processes, and you can scroll up and down through the
list.  Another neat command is pstree, which lists processes in a tree
form.


> With 16Mb ram, I have about 1 left when running logged in as root on
> tty5 and as user on tty1.  Is that not an excessive consumption for a
> shell that is not actually doing anything (top, of course).  What does
> that actually mean?  Without being able to see the bottom of top (!) I
> cannot add the figures up to see if they add up.

Post output of:

    $ free

GNU/Linux uses memory effectively.  That is, it uses it, for various
tasks, which it will then give up if needed.  Your system is supporting
processes in memory, shared memory, and cached access to your
filesystem, as well as processes swapped to disk.  Don't worry about
what top reports.  If your system bogs down and there's a lot of disk
access, you're in a memory starved situation.

Peace.

-- 
Karsten M. Self <kmself@ix.netcom.com>       http://kmself.home.netcom.com/
 What part of "Gestalt" don't you understand?             Home of the brave
  http://gestalt-system.sourceforge.net/                   Land of the free
   Free Dmitry! Boycott Adobe! Repeal the DMCA! http://www.freesklyarov.org
Geek for Hire                     http://kmself.home.netcom.com/resume.html

Attachment: pgpFVfv04ouhz.pgp
Description: PGP signature


Reply to: