6

I am trying to print out 40 or so different .doc files which are in a directory. There is no right-click option to print them all out if I select them. I don't want to open each one and then print them one by one.

Is there any way to batch print word (.doc) files in Ubuntu?

6

Create file in ~/.gnome2/nautilus-scripts and name it 'Print selected' or however you want. Copy paste this into it:

#!/bin/bash
for i in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
do
  lpr $i
done

Make it executable, restart Nautilus. Now you'll be able to print selected file(s) with right clicking the selection and choosing 'Print selected' from Scripts menu.

|improve this answer|||||
1

cd into the directory and then run something like find . -name "*.doc" -exec lpr {} \;

|improve this answer|||||
  • Replace *.doc with virtually any file mask that you want - to check first which files are you selecting run find . -name "*.doc" -exec echo {} \; to find more extensions use regex and separate with \| as find . -regex '.*\.\(doc\|jpg\)' -exec echo {} \; you can also combine with not find . -regex '.*\.\(doc\|jpg\)' -not -name "*.docnot" -exec echo {} \; – jave.web Mar 26 at 19:10
  • sidenote: for me it docx was unsupported, but jpg and pdf went fine :) – jave.web Mar 26 at 19:55
0

open your terminal and cd to that dir where you have files and then type

lpr file_name1 file_name2 file_name3

for easy filling your files name there press first two or three letters of that file name and give a TAB , so automatically it will fill that file name .

Hope that helps.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.