You print files in Linux with lp by sending a job to the print system from the terminal, usually with a command like lp myfile.pdf. That same print system also sits behind the print button in most desktop apps, so the path looks different but the job ends up in the same queue. For a student in an introduction to Linux course, that matters because lp teaches the basic shape of command-line work: name the file, name the printer, check the job, then cancel it if needed. A graphic print dialog hides that process. The terminal shows it. This is most relevant when you use Linux in class, on a remote lab machine, or over SSH. A desktop app can print a Word doc or PDF with a few clicks, but lp helps when you have only a shell prompt and a file path. You can also set copies, choose a destination, and send the same command again without hunting through menus. The main idea is simple. Printing in Linux has 2 faces: the easy click path and the command path. lp belongs to the second one, and it gives you direct control without making the process weird or hard.
How Does lp Fit Into Linux Printing?
lp sits between your file and the printer queue, and the desktop Print dialog often feeds the same backend, usually CUPS, on Linux systems from Ubuntu 24.04 to Fedora 40. That means the button in LibreOffice and the command in Terminal usually hand work to the same print service, even though one looks friendly and the other looks blunt.
The catch: The print dialog hides the queue name, job ID, and command flags, while lp shows all 3 in plain sight. That can feel rough at first, but a student in an introduction to Linux course learns faster when the machine stops hand-holding and starts showing real commands.
lp exists because terminal work solves simple jobs in seconds, especially on shared lab systems, remote shells, and server boxes where no desktop runs at all. You can type 1 line, send 1 PDF, and move on. That beats clicking through 4 menus when you already know the destination printer.
I like lp for practice because it makes printing feel like any other Linux task: direct, readable, and easy to repeat. A graphically printed page can hide a mistake until paper lands in the tray, but lp lets you see the exact command before you hit Enter. The downside is obvious too. If you hate terminals, lp will feel less cozy than the 2-click route inside a desktop app.
How Do You Print a File with lp?
Start with the printer name, the file path, and a basic lp command. A clean first try looks like lp report.pdf or lp -d HP_LaserJet report.pdf, and the job usually appears in less than 10 seconds on a normal CUPS setup.
- Open a terminal and check the printer name with lpstat -p or lpstat -a. That tells you the queue label before you send anything.
- Run lp with the file path, such as lp /home/student/Documents/report.pdf. If the file sits in your current folder, lp report.pdf works just fine.
- Use -d to pick a destination printer when you have more than 1 queue, like lp -d Office_Printer report.pdf. That matters on shared machines with 2 or 3 printers.
- Watch the response for a job ID, such as request id is Office_Printer-12. That number helps you track the job in under 30 seconds.
- If you spot the wrong file or wrong printer, cancel fast with cancel 12 or cancel Office_Printer-12. A quick cancel saves paper, toner, and a headache.
Reality check: lp does not need a fancy setup for basic printing, but it does need the file to exist and the printer queue to be reachable. A typo in a 1-word filename can stop the whole job cold.
Learn Introduction To Linux Online for College Credit
This is one topic inside the full Introduction To Linux course on UPI Study — a self-paced, online class that earns real college credit. Credits are ACE and NCCRS evaluated and transfer to partner colleges across the US and Canada. Courses start at $250 with no deadlines and lifetime access.
See Introduction To Linux →Which lp Options Matter Most?
You only need a small handful of lp options to handle most student printing jobs. In practice, 4 choices cover the everyday stuff: printer, copies, job name, and page layout.
- -d sends the file to a named printer, like lp -d Lab_Printer essay.pdf. That helps when 2 printers sit in the same room.
- -n sets copies, such as lp -n 3 poster.pdf. Three copies matter when you need handouts for a 20-minute class review.
- -t names the job, like lp -t FinalDraft essay.pdf. A clear job name helps when the queue fills up with 6 other files.
- -o lets you pass printer-supported choices, such as landscape or fit-to-page. The exact options depend on the printer model, and that part can feel annoyingly uneven.
- -P can target page ranges on some systems, like lp -P 1-2 notes.pdf. That saves time when you need only 2 pages from a 40-page file.
- -h points to a remote host or print server in some setups. You will see it more in labs, offices, and campus networks than on a home laptop.
Bottom line: Most beginners need only -d and -n on day 1, then maybe -t once they start sending 5 or more jobs a week. The rest can wait until a printer menu or class assignment forces the issue.
Why Use lp Instead of a Desktop Print Dialog?
lp wins when you want repeatable control, and the desktop Print dialog wins when you want speed inside a single app. That split shows up fast in real life: a script can call lp 20 times on a lab machine, while a student editing a PDF in Okular can just press Ctrl+P and pick the tray in 15 seconds.
Remote work makes the command line shine. If you connect by SSH to a Linux server at 11:40 p.m., you probably do not have a desktop session at all, but you still can print a file with lp if the server shares the right queue. That also helps in batch jobs, class labs, and simple automation, where the same command can print the same report every Friday.
The desktop dialog still has a real place. It feels easier for a one-time photo print, a form, or a 2-page PDF when you already have the app open. I would not force lp on someone who only prints twice a month from a GUI. That would be busywork, not skill-building.
What this means: lp matters most when you want control, speed, and a clean command you can repeat later. The dialog matters most when you want fewer decisions and a visual preview before the paper moves.
What Should You Check When Printing Fails?
Printing fails for a few boring reasons, and most of them show up in the first 60 seconds: the printer sits offline, the queue name is wrong, the file path does not exist, or the print service is stopped. On Ubuntu and other CUPS-based systems, one bad queue name can block a job even when the printer itself works fine. That is why a quick check list saves more time than random retries.
- Run lpstat -p to see whether the printer shows as ready.
- Use lpstat -o to confirm the job actually entered the queue.
- Check the file path with ls or pwd if lp says the file is missing.
- Look at permissions if the file lives in a shared folder or a locked directory.
- If the printer is not the default, use lp -d printer_name file.pdf instead of guessing.
If the queue looks stuck, cancel the job and resend it once. That simple move fixes more broken prints than people want to admit. A job ID like printer-14 gives you a clean target, and the printer name tells you where the file went. The downside is plain: Linux printing feels easy only after you learn 3 or 4 names and stop treating every printer like the same machine.
Frequently Asked Questions about Linux Printing
The surprise is that `lp` can send a file straight to a printer from the terminal in 1 command, and you don't need a desktop app for that. You can use it for PDFs, text files, and many image files on Linux systems with CUPS.
This applies to you if you use Linux with CUPS and want command-line printing, and it doesn't apply if you're only using a locked-down school lab with no printer access. If you can open a terminal on Ubuntu, Debian, Fedora, or similar systems, `lp` works for basic print jobs.
You print files in Linux with `lp` by typing `lp filename` in the terminal, and Linux sends that file to the default printer. If you want a different printer, add `-d printername`, and if you want 2 copies, add `-n 2`.
If you get the printer name wrong, your job fails or goes to the wrong device, and that wastes time fast. Use `lpstat -p` or `lpstat -d` to see printer names and the default printer before you send the file.
The most common wrong assumption is that `lp` and the graphical print dialog do different jobs, but they both send a print job to CUPS. The desktop dialog just gives you buttons, while `lp` gives you the same control from the terminal.
Most students click Print in LibreOffice, Firefox, or PDF viewers, and that works fine for normal use. `lp` works best when you want a quick terminal print, a script, or a file on a remote system with no desktop open.
You can print 1, 2, or 10 copies with `lp -n`, and you can also choose a printer with `-d` and a file format option with some setups. CUPS handles the job, so the exact options depend on the printer and driver.
Start by checking the printer list with `lpstat -p`, then send one small test file with `lp test.txt`. That first step tells you the printer name, the queue status, and whether your system can print at all.
An introduction to linux course often uses `lp` to teach basic terminal control, and that skill matters in admin work, labs, and shared machines. It also gives you a simple task you can repeat before you move on to scripts, permissions, and college credit work.
Yes, `lp` can help when your study online class gives you a local Linux assignment, and you need to print a worksheet or lab sheet fast. That same practical skill shows up in introduction to linux lessons and can support ace nccrs credit or college credit in systems courses.
Use the graphical print dialog when you're inside an app and want page range, duplex, or layout controls, and use `lp` when you already know the file name and printer. For a 3-page PDF or a text file, `lp` is usually faster than opening the file first.
Final Thoughts on Linux Printing
lp looks small, but it teaches a real Linux habit: name the file, name the printer, check the result, then fix the mistake without drama. That habit helps in class, at work, and on any machine where the terminal matters more than the app icon. The graphical Print dialog still matters. It gives you a fast preview, tray choices, and a simple path for one-off jobs. lp matters when you want repeatable control, remote access, or a clean command you can paste again later. Those two tools do not fight each other. They cover different moments. A student who learns both gets a better feel for Linux than someone who only clicks through menus. This is important in an introduction to Linux course, but it also spills into real work, because printers fail, queues jam, and file paths break at the worst time. Keep the first command simple. Check the printer name, print one file, read the job ID, and cancel it once just to see how it works. Then try the desktop dialog on the same file and notice how the same print system sits behind both paths. After that, printing stops feeling mysterious, and that is the part that really sticks.
How UPI Study credits actually work
Ready to Earn College Credit?
ACE & NCCRS approved · Self-paced · Transfer to colleges · $250/course or $99/month