7

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?

3 Answers 3

7

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.

1

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

2
  • 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, 2020 at 19:10
  • sidenote: for me it docx was unsupported, but jpg and pdf went fine :)
    – jave.web
    Mar 26, 2020 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .