export PATH=/usr/bin:/bin:/usr/sbin:/sbin export IFS=$' \t\n' echo 'Hello, world!' | enscript -q -B --word-wrap -f Helvetica30 -p - | lpr /usr/bin/lpstat -W completed /usr/bin/lpstat -W not-completed # clear the whole print queue #/usr/bin/cancel -a - # remove individual print jobs from the queue defaultprinter=$(/usr/sbin/system_profiler SPPrintersDataType | egrep -B 5 'Default: Yes' | head -n 1 | sed -e 's/^[[:space:]]*//' -e 's/:$//') alias opendefaultprinter='/usr/bin/open -a "$defaultprinter"' opendefaultprinter man 5 cupsd.conf # make a backup of cupsd.conf /usr/bin/sudo /bin/cp -p /private/etc/cups/cupsd.conf /private/etc/cups/cupsd.conf.orig # get line numbers of matching lines sed -E -n -e '/cups/=' /private/etc/cups/cupsd.conf sed -E -n -e '/^#PreserveJobHistory[[:space:]]+Yes/=' /private/etc/cups/cupsd.conf sed -E -n -e '/^[[:space:]]*PreserveJobHistory[[:space:]]+Yes/=' /private/etc/cups/cupsd.conf sed -E -n -e '/^[[:space:]]*PreserveJobHistory[[:space:]]+No/=' /private/etc/cups/cupsd.conf open -e /private/etc/cups/cupsd.conf nano /private/etc/cups/cupsd.conf # disable PreserveJobHistory in cupsd.conf /usr/bin/sudo /bin/ed -s /private/etc/cups/cupsd.conf <<< $',s|^#*PreserveJobHistory Yes|PreserveJobHistory No|\nw' /usr/bin/sudo /usr/bin/killall -HUP cupsd # reload cupsd.conf # enable PreserveJobHistory in cupsd.conf /usr/bin/sudo /bin/ed -s /private/etc/cups/cupsd.conf <<< $',s|^[[:space:]]*PreserveJobHistory No|PreserveJobHistory Yes|\nw' /usr/bin/sudo /usr/bin/killall -HUP cupsd # Mac OS X 10.5: Removing information about completed print jobs, # http://support.apple.com/kb/HT1857 # http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/cupsctl.8.html man 8 cupsctl cupsctl PreserveJobHistory=No cupsctl PreserveJobHistory=Yes
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
How to keep the list of completed print jobs empty (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» Create & print PDF files fro... in shell osx mac bash unix pdf create print manpage printer pstopdf enscript groff
» ws - web search from the com... in shell osx mac search bash unix commandline web
» snippet in shell osx mac html bash unix commandline web download convert textutil ed snippet
» Switching firewall settings ... in shell osx mac bash unix ipfw firewall ruleset switch
» Delete WebKit search fields in shell osx mac bash unix safari webkit
» pdftotext in shell osx mac bash unix pdf text convert
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails