Professional Web Applications Themes

Command line to print a page in Unix - Linux / Unix Administration

Guys, Its been a while that I work in a unix environment. I want to create a text file in pico or vi (just a test page). Whats the command for me to use to print that test page if my device is called lp_printer1? I would like to use this to troubleshot comunnications of serial printers and such. Btw, this is SCO Unix 5. Thanks, Tony...

Sponsored Links
  1. #1

    Default Command line to print a page in Unix

    Guys,

    Its been a while that I work in a unix environment.

    I want to create a text file in pico or vi (just a test page). Whats
    the command for me to use to print that test page if my device is
    called lp_printer1?

    I would like to use this to troubleshot comunnications of serial
    printers and such.

    Btw, this is SCO Unix 5.


    Thanks,
    Tony

    Sponsored Links
    tractng@gmail.com Guest

  2. #2

    Default Re: Command line to print a page in Unix

    In article <googlegroups.com>,
    <com> wrote: 

    Hmm, assuming "Unix 5" means it has some System V influence, try:

    lp -d lp_printer1 testpage

    If there's any BSD in the lineage try

    lpr -Plp_printer1 testpage

    At any rate, try "man lp" and "man lpr"


    Ted
    ted@brookside.tnolan.com Guest

  3. #3

    Default Re: Command line to print a page in Unix

    com wrote: 

    Try 'man lpr'.

    --
    Saludos,
    Ángel
    Ángel Guest

  4. #4

    Default Re: Command line to print a page in Unix

    Ted,

    Thanks for replying.

    Do I have to specify where the drivers/printers path?


    Thanks,
    Tony

    tractng@gmail.com Guest

  5. #5

    Default Re: Command line to print a page in Unix

    On 5 Jan 2006 13:39:46 -0800, com <com> wrote: 

    Not if you know the name of the printer or printqueue, which you seem
    to. man lp, or man lpr, and read the examples in the one which is
    appropriate to your SCO box.

    Dave Guest

  6. #6

    Default Re: Command line to print a page in Unix

    com wrote: 

    Usually with a test page you want to send it directly to the printer
    not through the queueing system. Doing that is consistant with
    trying to troubleshot the serial line rather than the software. Note
    that you better put a form feed as the last character of your text
    file if you're not using the print spooler to do that for you.

    Then something like "nohup cat text.txt > /dev/lp_printer1 &".

    You want to run it in background and have it hang out while
    you're thinking, whence the nohup and &. You want to avoid the
    spooler, whence the cat. (If this assumption is wrong see the
    other message in the thread not this one.

    The trouble is the serial line likely isn't named /dev/lp_printer1.
    Maybe "lpstat -t" will tell you the device name for the queue?
    Problem is that queue isn't necessarily pointed to the correct
    device. Look around in /dev/ for *tty* *cu* and such.

    Doug Guest

  7. #7

    Default Re: Command line to print a page in Unix

    If it is a network printer and you just want to test the printer then
    there is a built in capability for that as well.
    Assuming you have the printer working then it was likely setup in
    Scoadmin, Printers, HP Network Printer Manager. You can get to this
    from the desktop from within the System Administration folder, or from
    command line by typing scoadmin.
     
    network printer operation. All you need to know is the name or IP
    address of the printer. It then lets you send a test file, a
    PostScript file or a HP-GL/2 file to the printer. One of them is a
    picture of a jet.

    If it is a local printer off the parallel port then creating a file and
    using the lp commands will test it, you can also redirect data to the
    port, but that is just a way of troubleshooting problems with it.

    By default any print errors are sent to the mail of the user sending
    the print job.

    Also, typing:
    lpstat -t
    Gives you a nice breakdown of your printers and their status as well as
    any pending print jobs etc.
    That should help get you into the swing of things.
    Have fun!

    Tony

    Tonagon Guest

  8. #8

    Default Re: Command line to print a page in Unix

    Tonagon,

    You know alot of about printing. I recalled working with HP Print
    Manager a while back too when you mention #5 (Verify)-hehe.

    Anyways, is it possible to set up a laser printer through Unix and have
    it print color. I am haven't seen the system, but an uncle asked me
    that with not too much facts.


    Thanks,
    Tony

    tractng@gmail.com Guest

  9. #9

    Default Re: Command line to print a page in Unix

    Guys,

    Also, can you elaborate what "Note that you better put a form feed as
    the last character of your text
    file if you're not using the print spooler to do that for you. "

    What does form feed character look like in a pico file (text).

    Thanks a lot guys. I am a newbie here.

    Tony

    tractng@gmail.com Guest

  10. #10

    Default Re: Command line to print a page in Unix


    Guys,

    I did a lpstat -t and it shows part of the following.

    device for letter: /dev/tty02
    device for PTICKETS: /dev/ttya07

    So if I need to test a print I can use the following?


    lp -d /dev/ttya02 testpage

    nohup cat testpage /dev/ttya02 & (passing the spooler)


    thanks,
    Tony

    tractng@gmail.com Guest

  11. #11

    Default Re: Command line to print a page in Unix

    Strange thing, I have never had the occasion to print a color doc from
    SCO. I also have no access to a color printer to here at work with
    which to test.
    But I am sure the answer is yes. I just opened up google in Netscape
    that came installed with SCO and printed the web page from there, one
    of the print options is Greyscale of color and color is selected by
    default. When I printed it appears to have sent color (but since my
    printer is black and white and printed it up greyscale I cannot swear
    to it). So it looks like you do not have to do anything special in
    order to get it to print color, just have a color printer.

    Tonagon Guest

  12. #12

    Default Re: Command line to print a page in Unix

    Crud, me and my lousy typing. That was supposed to say "Greyscale OR
    color and color is selected by default".

    Tonagon Guest

Similar Threads

  1. Question Use Command line to set Print Scaling with a PDF
    By djenkins in forum Brainstorming Area
    Replies: 0
    Last Post: December 3rd, 10:15 PM
  2. To print a doent from command line
    By bhargava_bhatt@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 1
    Last Post: September 29th, 07:49 AM
  3. Windows Print PDF from Command Line
    By Lorraine_Siegmann@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 3
    Last Post: April 6th, 08:49 PM
  4. RUN/execute a Command-Line command from an ASP page
    By Lucas Cowald in forum ASP.NET Building Controls
    Replies: 1
    Last Post: October 22nd, 04:26 PM
  5. RUN/execute a Command-Line command from an ASP page.
    By Lucas Cowald in forum ASP Components
    Replies: 7
    Last Post: October 22nd, 01:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139