i want to cancel printing job

hi every body
i used " lpstat -o" to show the printer jobs and i already canceld it by "cancel -e -f jobid"
but the problem i found when used " lpstat -o" again it said that job in progress i think because it in the buffer but i don't know how to clear the printer.

were you root when you did a cancel -e ? ( -e only works for priviledged users...)

Your command has too many switches and in my version there is no "-f" switch.

To cancel one job for your user (or any user if you are root):
cancel <jobid>

As root, to cancel all jobs for a printer:
cancel <printer> -e

thanks alot for your attention but i need to know when the job in progress it has ajob id or not i didn't find any id for it i think because it goes now in cash or because it is in printing mode

??
dont know what you are asking for, look at this sequence:

ran:/sm/bin $ lpstat -t
scheduler is running
no system default destination
device for lpvbe: /dev/null
device for xeroxsas: /dev/null
lpvbe accepting requests since Sep 10 19:19
xeroxsas accepting requests since Nov  8 18:07
printer lpvbe disabled since Sep 10 16:29 -
        reason unknown
        fence priority : 0
printer xeroxsas is idle.  enabled since Nov  8 18:07
        fence priority : 0
no entries
ran:/sm/bin $ lp -oc -olm8 -onb -dlpvbe mflm
request id is lpvbe-96 (1 file)
ran:/sm/bin $ lpstat -t
scheduler is running
no system default destination
device for lpvbe: /dev/null
device for xeroxsas: /dev/null
lpvbe accepting requests since Sep 10 19:19
xeroxsas accepting requests since Nov  8 18:07
printer lpvbe disabled since Sep 10 16:29 -
        reason unknown
        fence priority : 0
printer xeroxsas is idle.  enabled since Nov  8 18:07
        fence priority : 0
lpvbe-96            vbe            priority 0  Jun 15 10:20
        mflm                                    793 bytes
ran:/sm/bin $ lpstat -o lpvbe
lpvbe-96            vbe            priority 0  Jun 15 10:20
        mflm                                    793 bytes
lpvbe-96            vbe            priority 0  Jun 15 10:20
        mflm                                    793 bytes
lpvbe-96            vbe            priority 0  Jun 15 10:20
        mflm                                    793 bytes
ran:/sm/bin $ enable lpvbe
printer "lpvbe" now enabled
ran:/sm/bin $ lpstat -o lpvbe
lpvbe-96            vbe            priority 0  Jun 15 10:20 on lpvbe
        mflm                                    793 bytes
lpvbe-96            vbe            priority 0  Jun 15 10:20 on lpvbe
        mflm                                    793 bytes
ran:/sm/bin $ lpstat -t
scheduler is running
no system default destination
device for lpvbe: /dev/null
device for xeroxsas: /dev/null
lpvbe accepting requests since Sep 10 19:19
xeroxsas accepting requests since Nov  8 18:07
printer lpvbe now printing lpvbe-96.  enabled since Jun 15 10:20
        fence priority : 0
printer xeroxsas is idle.  enabled since Nov  8 18:07
        fence priority : 0
lpvbe-96            vbe            priority 0  Jun 15 10:20 on lpvbe
        mflm                                    793 bytes
ran:/sm/bin $ lpstat -t
scheduler is running
no system default destination
device for lpvbe: /dev/null
device for xeroxsas: /dev/null
lpvbe accepting requests since Sep 10 19:19
xeroxsas accepting requests since Nov  8 18:07
printer lpvbe now printing lpvbe-96.  enabled since Jun 15 10:20
        fence priority : 0
printer xeroxsas is idle.  enabled since Nov  8 18:07
        fence priority : 0
printer xeroxsas is idle.  enabled since Nov  8 18:07
        fence priority : 0
lpvbe-96            vbe            priority 0  Jun 15 10:20 on lpvbe
        mflm                                    793 bytes
ran:/sm/bin $ lpstat -t
scheduler is running
no system default destination
device for lpvbe: /dev/null
device for xeroxsas: /dev/null
lpvbe accepting requests since Sep 10 19:19
xeroxsas accepting requests since Nov  8 18:07
printer lpvbe is idle.  enabled since Jun 15 10:20
        fence priority : 0
printer xeroxsas is idle.  enabled since Nov  8 18:07
        fence priority : 0
no entries

---------- Post updated at 10:52 ---------- Previous update was at 10:42 ----------

To follow:

ran:/sm/bin $ disable lpvbe
printer "lpvbe" now disabled
mairan:/sm/bin $ r lp
lpstat -t
scheduler is running
no system default destination
device for lpvbe: /dev/null
device for xeroxsas: /dev/null
lpvbe accepting requests since Sep 10 19:19
xeroxsas accepting requests since Nov  8 18:07
printer lpvbe disabled since Jun 15 10:44 -
        reason unknown
        fence priority : 0
printer xeroxsas is idle.  enabled since Nov  8 18:07
        fence priority : 0
no entries
ran:/sm/bin $ lp -oc -olm8 -onb -dlpvbe mflm
request id is lpvbe-98 (1 file)
ran:/sm/bin $ lpstat -t
scheduler is running
no system default destination
device for lpvbe: /dev/null
device for xeroxsas: /dev/null
lpvbe accepting requests since Sep 10 19:19
xeroxsas accepting requests since Nov  8 18:07
printer lpvbe disabled since Jun 15 10:44 -
        reason unknown
        fence priority : 0
printer xeroxsas is idle.  enabled since Nov  8 18:07
        fence priority : 0
lpvbe-98            vbe            priority 0  Jun 15 10:44
        mflm                                    793 bytes
ran:/sm/bin $ lpstat -o lpvbe
         mflm                                    793 bytes
ran:/sm/bin $ lpstat -o lpvbe
lpvbe-98            vbe            priority 0  Jun 15 10:44
        mflm                                    793 bytes
lpvbe-98            vbe            priority 0  Jun 15 10:44
        mflm                                    793 bytes
ran:/sm/bin $ cancel lpvbe-98
request "lpvbe-98" cancelled
ran:/sm/bin $ lpstat -o lpvbe
no entries
no entries
ran:/sm/bin $ lpstat -t
scheduler is running
no system default destination
device for lpvbe: /dev/null
device for xeroxsas: /dev/null
lpvbe accepting requests since Sep 10 19:19
xeroxsas accepting requests since Nov  8 18:07
printer lpvbe disabled since Jun 15 10:44 -
        reason unknown
        fence priority : 0
printer xeroxsas is idle.  enabled since Nov  8 18:07
        fence priority : 0
no entries
ran:/sm/bin $ enable lpvbe
printer "lpvbe" now enabled

etc...

when i print something i list the job by lpstat -t so i see the jobid but if the printer in progress of printing i didn't find the job id but the printer now is printing so i need to cancel this job whiout i have the jobid

What you ask is not possible from unix "lp" commands. Once the job has left the unix print queue it has gone.

In this case you'll need to cancel the job on the printer itself ... or from the print server software if it is actually a print server.

very good how can i cancel the job from the printer it self as you said ? same like " clear printer buffer"

That will be on the printer itself either by its menu or key/button (like laserjet4000 red-pink button : "Cancel Job") or turn off the printer and bring it back up agin...

thanks alot for your replay .