Professional Documents
Culture Documents
Chapter 3 Network File System
Chapter 3 Network File System
Chapter 3 Network File System
• After creating the export folder, we will need to provide the clients
the permission to access the host server machine. This permission is
defined through the exports file located in your system’s /etc folder.
$ sudo /etc/exports
• Once you have opened the file, you can allow access to:
• After making all the above configurations in the host system, now is
the time to export the shared directory through the following
command as sudo:
$ sudo exportfs –a
Sudo systemctl enable nfs-kernel-server
Step 5: Open firewall for the client (s)
• Your client’s system needs a directory where all the content shared by
the host server in the export folder can be accessed. You can create
this folder anywhere on your system. We are creating a mount folder
in the mnt directory of our client’s machine:
• $ sudo mkdir -p /mnt/sharedfolder_client
Step 3: Mount the shared directory on the client
• The folder that you created in the above step is like any other folder on
your system unless you mount the shared directory from your host to
this newly created folder.
• Use the following command in order to mount the shared folder from
the host to a mount folder on the client:
• $ umount /data
Introduction to printing
• Printing in Linux involves sending documents or files from your computer to a
physical printer for hard-copy output.
• Here are the general steps to print in Linux:
• Connect the Printer:
• Install Printer Drivers:
• Open the Document:
• Select Printer and Configure Settings:
• Print the Document:
• Monitor the Print Queue:
• Manage Print Jobs:
• Troubleshooting:
Components in printing System.
• Print Device File
• Spooler:
• A software program responsible for managing all print jobs currently
being sent to the computer printer or print server.
• The print spooler program may allow a user to delete a print job
being processed or otherwise manage the print jobs currently waiting
to be printed.
• he spooler also handles communication between the application, the
printer driver, and the printer.
Print queue
• A print queue is a list of printer output jobs held in a reserved memory area. It
maintains the most current status of all active and pending print jobs.
• A print queue generally displays the following information:
Document name: Shows the file name of the print job
• Status: Indicates the status of the print job
• Owner: Shows the user, which is helpful in a shared network printing
environment
• Pages: Shows the total number of printed pages
• Size: Shows the printed document size, usually in KB
• Submitted: Shows the date and timestamp of a pending or printed document
• Port: Shows the printer port
/etc/printcap
• The /etc/printcap file is a configuration file used in Unix-like operating
systems, including Linux, to define printer settings and capabilities
for the system's printing subsystem.
• It's a plain text file that provides information about the printers
available on the system, their capabilities, and how print jobs should
be processed and sent to the printers.
• The printcap database for describing printers
• The spooling system accesses the printcap file every time it is used, so
you can dynamically add or remove printers.
• Each entry in the database describes one printer.
Managing the Print Queues
lp Command
• The lp command is a command-line utility in Linux and other Unix-like
operating systems that is used to send print jobs to printers. It is a part
of the printing subsystem and allows users to print documents and files
from the command line. Linux lp printing command examples
• Commonly used options with the lp command include:
• -d printer: Specifies the printer to which the print job should be sent.
• -n copies: Specifies the number of copies to print.
• -o option=value: Specifies additional options for printing, such as page
orientation, page size, etc.
• -q priority: Sets the print job priority in the print queue.
• Print a file named document.txt to the default printer:
• lp document.txt
• Print multiple copies of a file and set the printer:
• lp -d printer_name -n 3 document.txt
lpq
• The lpq command is a command-line utility in Linux and other Unix-like
operating systems that allows you to view the print queue status and
display information about print jobs that are waiting to be printed.
• It provides a snapshot of the current state of the print queue, showing
details about pending print jobs, such as their job IDs, owner names, status,
and position in the queue.
• lpq [options] [printer]
• Here, [options] are various command options you can use with the lpq
command, and [printer] is the name of the printer whose queue you want
to view. If you omit the printer name, the lpq command will display
information for the default printer.
• -P printer: Specifies the name of the printer whose queue you want to
view.
• -a: Shows all printers' queues, not just the default printer.
• -l: Provides more detailed information, including the time the job was
submitted and the size of the print job.
lprm
• The lprm command is a command-line utility in Linux and other Unix-
like operating systems that allows you to remove or cancel print jobs
from the print queue.
• It is used to delete print jobs that are currently waiting to be printed
or are in the process of being printed.
• The lprm command requires administrative privileges (usually
superuser or root access) in order to remove print jobs from the
queue.
• lprm [options] [job number(s)] [user(s)]
• Here, [options] are various command options you can use with the
lprm command, [job number(s)] are the identifiers of the print jobs
you want to remove, and [user(s)] are the names of users whose print
jobs you want to remove. If you don't specify any job numbers or
users, lprm will remove the jobs of the current user.
• Commonly used options with the lprm command include:
• -: Removes all jobs belonging to the current user.
• -P printer: Specifies the name of the printer from which you want to
remove jobs.
• -U user: Removes jobs belonging to the specified user.
• -J job-name: Removes jobs with the specified name.
lpstat
• used to display information about print queues and printer status on a
system. It provides various details about the current state of printers
and print jobs, which can be useful for administrators and users who
need to manage printing tasks.
• Displaying a list of available printers and their status.
• Showing the status of print jobs in the queue, such as whether they
are printing, held, or completed.
• Providing information about the default printer.
• Showing information about the classes of printers (groups of printers
that share the same destination).
• To display a list of printers and their status:
• lpstat –p
• To display information about a specific printer (replace printer-name with the actual
printer name):
• lpstat -p printer-name
• To display the status of print jobs in the queue:
• lpstat –o
• To display information about the default printer:
• lpstat –d
• To display information about printer classes:
• lpstat -c
Installing CUPS