How to send printer control codes from Unix

Posted on 2005-04-29
Last Modified: 2008-02-01
I have been tinkering for hours but to no avail.  
What is the Unix command to send control codes to the printer which will then produce 17pt font or condensed mode?  
I tried:
# echo ESC ( s 17 H
I also tried it in decimal and hex.

Thanks in advance,
Question by:MikeSievers
    1 Comment
    LVL 16

    Accepted Solution

    The command
      echo "\033(s17H\c"
    will do. \033 stands for ESC (octal value 33 in the ASCII character set -- see man ascii)

    Make sure your printer (filter) does allow raw data (does not filter it out, changes to plain text)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
    Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now