# How to add form feed for printing in linux

**URL:** <https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205>\
**Category:** Red Hat\
**Created:** [October 13, 2021, 6:38am UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205 "2021-10-13T06:38:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![alicetan](https://community.unix.com/letter_avatar/alicetan/32/5_5575768a8748004e209b776fc1b2916d.png) [@alicetan](https://community.unix.com/u/alicetan)\
**Post date:** [October 13, 2021, 6:38am UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/1 "2021-10-13T06:38:21Z")

</div>

Hi All,

in Unix platform, if we want to add the form feed for the printer, we will edit the printer file in

```
/etc/lp/interface/model.orig/ folder with the "echo "\f\c" ". 

```

May i know that in Linux, how we can add this form feed?  
Because in Linux, i can't found the same folder.

Thank You.

---

<div class="post-metadata">

**Author:** ![Neo](https://community.unix.com/user_avatar/community.unix.com/neo/32/22838_2.png) [@Neo](https://community.unix.com/u/Neo)\
**Post date:** [October 13, 2021, 6:52am UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/3 "2021-10-13T06:52:13Z")

</div>

> [@alicetan](#):
>
> Because in Linux, i can't found the same folder.

Hi @alicetan

You are using CUPS on RED-HAT?

See, for example:

> **[Chapter 12. Configuring printing Red Hat Enterprise Linux 8 | Red...](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/configuring-printing_deploying-different-types-of-servers)**
>
> Access Red Hat’s knowledge, guidance, and support through your subscription.

If you are using CUPS, then this narrows the question to something more managable.

If not CUPS, what are you using to manage your printer?

See also, FYI only:

[http://etutorials.org/Linux+systems/red+hat+linux+9+professional+secrets/Part+I+Setting+Up+Red+Hat+Linux/Chapter+4+Printer+Setup/Understanding+the+CUPS+Printing+System/](http://etutorials.org/Linux+systems/red+hat+linux+9+professional+secrets/Part+I+Setting+Up+Red+Hat+Linux/Chapter+4+Printer+Setup/Understanding+the+CUPS+Printing+System/)

---

<div class="post-metadata">

**Author:** ![alicetan](https://community.unix.com/letter_avatar/alicetan/32/5_5575768a8748004e209b776fc1b2916d.png) [@alicetan](https://community.unix.com/u/alicetan)\
**Post date:** [October 13, 2021, 7:27am UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/4 "2021-10-13T07:27:33Z")

</div>

Hi Neo,

Yes, we are using CUPS, but it seem that CUPS do not have the setting for form feed(page eject).  
Do you have idea how to set the form feed?

Because we are new in Linux platform so we are not familiar with CUPS also.

Thank You.

---

<div class="post-metadata">

**Author:** ![Neo](https://community.unix.com/user_avatar/community.unix.com/neo/32/22838_2.png) [@Neo](https://community.unix.com/u/Neo)\
**Post date:** [October 13, 2021, 8:05am UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/5 "2021-10-13T08:05:13Z")

</div>

> [@alicetan](#):
>
> CUPS

So, do you normally print using the `lp` command, for example:

```plaintext
lp -d printer -o PageSize=A4 /path/filename

```

What are you trying to do exactly? Advance based on page size when printing? What is the problem you want to solve?

Reference:

[https://www.cups.org/doc/options.html](https://www.cups.org/doc/options.html)

---

<div class="post-metadata">

**Author:** ![MadeInGermany](https://community.unix.com/letter_avatar/madeingermany/32/5_5575768a8748004e209b776fc1b2916d.png) [@MadeInGermany](https://community.unix.com/u/MadeInGermany)\
**Post date:** [October 13, 2021, 11:50am UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/6 "2021-10-13T11:50:27Z")

</div>

The  
`echo "\f\c"`  
works with the SysV `echo` (where /bin/sh is linked to ksh or is a Bourne shell).

For BSD and Linux you need the portable form  
`printf "\f\c\n"`  
(that works with all shells).

It is somehow possible to place an executable shell script into the CUPS filters. But it's quite some time ago that I worked with custom filters...

---

<div class="post-metadata">

**Author:** ![alicetan](https://community.unix.com/letter_avatar/alicetan/32/5_5575768a8748004e209b776fc1b2916d.png) [@alicetan](https://community.unix.com/u/alicetan)\
**Post date:** [October 13, 2021, 2:33pm UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/7 "2021-10-13T14:33:58Z")

</div>

Hi Neo,

we are not using the lp command to print the document, we are using the -Q printername and send the job to the printer device in server and print it out.

The problem we facing now is when we print the document, it do not have the page eject and causing alignment issue when print 2 document at a time.

We are new to Linux, previously we are using HP-UX.  
In HP-UX environment, there is a file in "/etc/lp/interface/model.orig/" we can edit it to add in the "echo "\f\c", then when we choose to print to the printer, it will have the page eject.

But now in Linux, we can't find the way to add in this "echo "\f\c" to solve the page eject issue.

So hope that anyone in the group here can share some experience with us.

Thank You.

---

<div class="post-metadata">

**Author:** ![alicetan](https://community.unix.com/letter_avatar/alicetan/32/5_5575768a8748004e209b776fc1b2916d.png) [@alicetan](https://community.unix.com/u/alicetan)\
**Post date:** [October 13, 2021, 2:34pm UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/8 "2021-10-13T14:34:50Z")

</div>

Hi Madeln,

Can you share with us your experience how to using the "echo "\f\c" in Linux?

Thank You.

---

<div class="post-metadata">

**Author:** ![MadeInGermany](https://community.unix.com/letter_avatar/madeingermany/32/5_5575768a8748004e209b776fc1b2916d.png) [@MadeInGermany](https://community.unix.com/u/MadeInGermany)\
**Post date:** [October 13, 2021, 5:56pm UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/9 "2021-10-13T17:56:38Z")

</div>

You can test it on the command line.  
In Linux in a `/bin/sh` shell  
`echo "\f\c"`  
will print  
`\f\c`  
While  
`printf "\f"`  
will do some "formfeed" action, e.g. clear the screen.  
On Unix in a `/bin/sh` shell you will find that both commands behave the same.

Sorry, the `\c\n` (as in my last post) should not be in the printf.

---

<div class="post-metadata">

**Author:** ![Neo](https://community.unix.com/user_avatar/community.unix.com/neo/32/22838_2.png) [@Neo](https://community.unix.com/u/Neo)\
**Post date:** [October 14, 2021, 1:12am UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/10 "2021-10-14T01:12:37Z")

</div>

> [@alicetan](#):
>
> But now in Linux, we can't find the way to add in this "echo "\f\c" to solve the page eject issue.

Hey @alicetan

If you take a peek at the CUPS documentation, you can see that to submit commands to your default printer, typically you use:

```shell
# lpr filename

```

So, if you want to send any command to the printer, you can put the command in a file and then run the `lpr` command.

I have not tested this, but you can try to simply put the command you want to execute in a file and send that to the printer via `lpr`, for example to only print a form feed, or page feed, just put that sequence to send to the printer in a file and try sending it to the printer with `lpr` as above.

When you get this first step working; then you can see if you can add a CUPS filter or command to the pre-print process and you should be good to go.

I don't have a printer, so I cannot try this for you; but if you try some things and post back your results, we can help you get this working.

References:

> **[lpr(1) \[linux man page\]](https://www.unix.com/man-page/linux/1/lpr/)**
>
> lpr submits files for printing. Files named on the command line are sent to the named printer (or the default destination if no destination is specified). If no files are listed on the command-line, lpr reads the print file from t

> **[Using a CUPS printer from command line](https://www.g-loaded.eu/2005/11/10/using-a-cups-printer-from-command-line/)**
>
> This article will guide you through the process of using your CUPS printer by issuing commands in the terminal and also outlines the available print job options you can set in order to fine tune the final prints.

---

<div class="post-metadata">

**Author:** ![Neo](https://community.unix.com/user_avatar/community.unix.com/neo/32/22838_2.png) [@Neo](https://community.unix.com/u/Neo)\
**Post date:** [October 14, 2021, 1:15am UTC](https://community.unix.com/t/how-to-add-form-feed-for-printing-in-linux/384205/11 "2021-10-14T01:15:09Z")

</div>

> [@MadeInGermany](#):
>
> `printf "\f"`  
> will do some "formfeed" action, e.g. clear the screen.

I think using `lpr` to test the printer will go a long way to getting a CUPS system tested and debugged.
